Patchwork D1885: commands: rewrite legacy ternary operator hack using modern syntax

login
register
mail settings
Submitter phabricator
Date Feb. 1, 2018, 8:33 p.m.
Message ID <d0402413337dbcbbadcbeace8b08821c@localhost.localdomain>
Download mbox | patch
Permalink /patch/27126/
State Not Applicable
Headers show

Comments

phabricator - Feb. 1, 2018, 8:33 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGa7ba11fbdd4b: commands: rewrite legacy ternary operator hack using modern syntax (authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D1885?vs=5040&id=5055

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

AFFECTED FILES
  mercurial/commands.py

CHANGE DETAILS




To: durin42, #hg-reviewers, pulkit, indygreg
Cc: mercurial-devel

Patch

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -1219,7 +1219,7 @@ 
             raise error.Abort(_("--base is incompatible with specifying "
                                "a destination"))
         common = [repo.lookup(rev) for rev in base]
-        heads = revs and map(repo.lookup, revs) or None
+        heads = map(repo.lookup, revs) if revs else None
         outgoing = discovery.outgoing(repo, common, heads)
     else:
         dest = ui.expandpath(dest or 'default-push', dest or 'default')