pushbookmark: remove a <cond> and <val> or <other> construct
authorPierre-Yves David <pierre-yves.david@fb.com>
Fri, 15 Aug 2014 17:58:15 -0700
changeset 22227 98cbd41cb532
parent 22226 827bce9e24fb
child 22228 a3dc2d385490
pushbookmark: remove a <cond> and <val> or <other> construct We make the conditional explicit for the sake of readability.
mercurial/exchange.py
--- a/mercurial/exchange.py	Fri Aug 15 16:31:06 2014 -0700
+++ b/mercurial/exchange.py	Fri Aug 15 17:58:15 2014 -0700
@@ -617,8 +617,10 @@
     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)