D6707: revset: drop argument when it's None

av6 (Anton Shestakov) phabricator at mercurial-scm.org
Fri Aug 2 04:12:21 EDT 2019


av6 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  getstack's definition is `getstack(repo, rev=None)`, so providing None
  explicitly is unnecessary. Moreover, when x is not None, it's definitely not a
  revision but a part of a parsed tree of revset arguments.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/revset.py

CHANGE DETAILS

diff --git a/mercurial/revset.py b/mercurial/revset.py
--- a/mercurial/revset.py
+++ b/mercurial/revset.py
@@ -1695,7 +1695,7 @@
     parent. (EXPERIMENTAL)
     """
     if x is None:
-        stacks = stackmod.getstack(repo, x)
+        stacks = stackmod.getstack(repo)
     else:
         stacks = smartset.baseset([])
         for revision in getset(repo, fullreposet(repo), x):



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


More information about the Mercurial-devel mailing list