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

pulkit (Pulkit Goyal) phabricator at mercurial-scm.org
Tue Dec 26 14:16:35 EST 2017


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

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', '')



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


More information about the Mercurial-devel mailing list