commands: check for empty rev before passing to scmutil.unhidehashlikerevs
authorPulkit Goyal <7895pulkit@gmail.com>
Tue, 26 Dec 2017 22:54:45 +0530
changeset 35517 ba0fb0e33c3a
parent 35516 6a1a0a023fc1
child 35518 02fdb8c018aa
commands: check for empty rev before passing to scmutil.unhidehashlikerevs Differential Revision: https://phab.mercurial-scm.org/D1760
mercurial/commands.py
--- a/mercurial/commands.py	Mon Jan 01 16:48:31 2018 +0100
+++ b/mercurial/commands.py	Tue Dec 26 22:54:45 2017 +0530
@@ -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', '')
@@ -1995,7 +1996,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, None)
 
     end = '\n'
@@ -2779,7 +2781,8 @@
         fm.data(node=hex(remoterev))
         fm.data(bookmarks=fm.formatlist(bms, name='bookmark'))
     else:
-        repo = scmutil.unhidehashlikerevs(repo, [rev], 'nowarn')
+        if rev:
+            repo = scmutil.unhidehashlikerevs(repo, [rev], 'nowarn')
         ctx = scmutil.revsingle(repo, rev, None)
 
         if ctx.rev() is None:
@@ -3513,7 +3516,8 @@
 
     char = {'l': '@', 'x': '*', '': ''}
     mode = {'l': '644', 'x': '755', '': '644'}
-    repo = scmutil.unhidehashlikerevs(repo, [node], 'nowarn')
+    if node:
+        repo = scmutil.unhidehashlikerevs(repo, [node], 'nowarn')
     ctx = scmutil.revsingle(repo, node)
     mf = ctx.manifest()
     ui.pager('manifest')
@@ -3702,7 +3706,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, None)
 
     if file_: