[PATCH 4 of 6] pushbookmark: remove a <cond> and <val> or <other> construct

Pierre-Yves David pierre-yves.david at ens-lyon.org
Mon Aug 18 16:50:02 CDT 2014


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at fb.com>
# Date 1408150695 25200
#      Fri Aug 15 17:58:15 2014 -0700
# Node ID 35c3e0ecdddf3d777f48f978788c5e418967f0f2
# Parent  032e5a4ffd4341b22f2135d26cd8172e64cabfb6
pushbookmark: remove a <cond> and <val> or <other> construct

We make the conditional explicit for the sake of readability.

diff --git a/mercurial/exchange.py b/mercurial/exchange.py
--- a/mercurial/exchange.py
+++ b/mercurial/exchange.py
@@ -615,12 +615,14 @@ def _pushbookmark(pushop):
     """Update bookmark position on remote"""
     ui = pushop.ui
     repo = pushop.repo.unfiltered()
     remote = pushop.remote
     ui.debug("checking for updated bookmarks\n")
-    revnums = map(repo.changelog.rev, pushop.revs or [])
-    ancestors = repo.changelog.ancestors(revnums, inclusive=True)
+    ancestors = ()
+    if pushop.revs:
+        revnums = map(repo.changelog.rev, pushop.revs)
+        ancestors = repo.changelog.ancestors(revnums, inclusive=True)
     (addsrc, adddst, advsrc, advdst, diverge, differ, invalid
      ) = bookmarks.compare(repo, repo._bookmarks, remote.listkeys('bookmarks'),
                            srchex=hex)
 
     for b, scid, dcid in advsrc:


More information about the Mercurial-devel mailing list