Patchwork D1760: commands: check for empty rev before passing to scmutil.unhidehashlikerevs

login
register
mail settings
Submitter phabricator
Date Dec. 26, 2017, 7:16 p.m.
Message ID <differential-rev-PHID-DREV-4ctvoxk6ugxkjsvwqg7v-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/26447/
State Superseded
Headers show

Comments

phabricator - Dec. 26, 2017, 7:16 p.m.
pulkit created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D1760

AFFECTED FILES
  mercurial/commands.py

CHANGE DETAILS




To: pulkit, #hg-reviewers
Cc: mercurial-devel
phabricator - Dec. 27, 2017, 12:22 p.m.
yuja requested changes to this revision.
yuja added a comment.
This revision now requires changes to proceed.


  Can you update the other callers which pass `['']`?

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D1760

To: pulkit, #hg-reviewers, yuja
Cc: yuja, mercurial-devel

Patch

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -1280,7 +1280,8 @@ 
     """
     opts = pycompat.byteskwargs(opts)
     rev = opts.get('rev')
-    repo = scmutil.unhidehashlikerevs(repo, [rev], 'nowarn')
+    if rev:
+        repo = scmutil.unhidehashlikerevs(repo, [rev], 'nowarn')
     ctx = scmutil.revsingle(repo, rev)
     m = scmutil.match(ctx, (file1,) + pats, opts)
     fntemplate = opts.pop('output', '')