Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(772)

Issue 329393002: Revert of scm.GIT.IsValidRevision: Only return True if the given object is a commit (Closed)

Created:
6 years, 6 months ago by Ryan Tseng
Modified:
6 years, 5 months ago
Reviewers:
iannucci, borenet, M-A Ruel
CC:
chromium-reviews, Dirk Pranke, cmp-cc_chromium.org, iannucci+depot_tools_chromium.org, ilevy-cc_chromium.org
Visibility:
Public.

Description

Revert of scm.GIT.IsValidRevision: Only return True if the given object is a commit (https://codereview.chromium.org/329823002/) Reason for revert: Speculative revert to see if this is the cause of auto_roll_test.py to fail in build/ presubmit. Original issue's description: > scm.GIT.IsValidRevision: Only return True if the given object is a commit > > BUG=383476 > > Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=276487 TBR=iannucci@chromium.org,maruel@chromium.org,borenet@google.com NOTREECHECKS=true NOTRY=true BUG=383476

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+3 lines, -18 lines) Patch
M scm.py View 1 chunk +3 lines, -6 lines 0 comments Download
M tests/scm_unittest.py View 2 chunks +0 lines, -12 lines 0 comments Download

Messages

Total messages: 9 (0 generated)
Ryan Tseng
Created Revert of scm.GIT.IsValidRevision: Only return True if the given object is a commit
6 years, 6 months ago (2014-06-11 22:10:29 UTC) #1
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/hinoka@google.com/329393002/1
6 years, 6 months ago (2014-06-11 22:10:53 UTC) #2
M-A Ruel
lgtm
6 years, 6 months ago (2014-06-11 22:12:23 UTC) #3
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 6 months ago (2014-06-11 22:27:34 UTC) #4
commit-bot: I haz the power
Failed to commit the patch. Sending depot_tools/scm.py Sending depot_tools/tests/scm_unittest.py Transmitting file data ..
6 years, 6 months ago (2014-06-11 22:27:35 UTC) #5
Ryan Tseng
The CQ bit was checked by hinoka@google.com
6 years, 6 months ago (2014-06-11 23:08:44 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/hinoka@google.com/329393002/1
6 years, 6 months ago (2014-06-11 23:09:15 UTC) #7
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 6 months ago (2014-06-11 23:09:20 UTC) #8
commit-bot: I haz the power
6 years, 6 months ago (2014-06-11 23:09:21 UTC) #9
Failed to apply patch for depot_tools/scm.py:
While running patch -p1 --forward --force --no-backup-if-mismatch;
  patching file depot_tools/scm.py
  Hunk #1 FAILED at 491.
  1 out of 1 hunk FAILED -- saving rejects to file depot_tools/scm.py.rej

Patch:       depot_tools/scm.py
Index: scm.py
diff --git depot_tools/scm.py depot_tools/scm.py
index
d60453dceff9c1e1362d0be94e368e2112619663..eb5c52403c3e2595d14b133a7d0d00e289811d10
100644
--- a/depot_tools/scm.py
+++ b/depot_tools/scm.py
@@ -491,15 +491,12 @@
       sha = GIT.Capture(['rev-parse', lookup_rev], cwd=cwd).lower()
       if lookup_rev != rev:
         # Make sure we get the original 40 chars back.
-        if rev.lower() != sha:
-          return False
+        return rev.lower() == sha
       if sha_only:
-        if not sha.startswith(rev.lower()):
-          return False
+        return sha.startswith(rev.lower())
+      return True
     except subprocess2.CalledProcessError:
       return False
-    obj_type = GIT.Capture(['cat-file', '-t', rev], cwd=cwd).strip()
-    return obj_type == 'commit'
 
   @classmethod
   def AssertVersion(cls, min_version):

Powered by Google App Engine
This is Rietveld 408576698