From patchwork Thu Dec 28 19:41:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D1760: commands: check for empty rev before passing to scmutil.unhidehashlikerevs From: phabricator X-Patchwork-Id: 26481 Message-Id: <0f1d264acf1ecade162980af9c5846ca@localhost.localdomain> To: mercurial-devel@mercurial-scm.org Date: Thu, 28 Dec 2017 19:41:06 +0000 pulkit updated this revision to Diff 4659. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D1760?vs=4621&id=4659 REVISION DETAIL https://phab.mercurial-scm.org/D1760 AFFECTED FILES mercurial/commands.py CHANGE DETAILS To: pulkit, #hg-reviewers, yuja Cc: yuja, mercurial-devel 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', '') @@ -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_: