Mercurial > hg
changeset 26603:517ffec37dee
discovery: put trivial branch first
Having the simple and tiny branch of the conditional first help readability. The
"else" that appears after a screen of code is harder to relate to a conditional.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Mon, 12 Oct 2015 00:45:24 -0700 |
parents | c062a9c0293c |
children | a3fcc8e3136b |
files | mercurial/discovery.py |
diffstat | 1 files changed, 3 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/discovery.py Fri Oct 09 15:31:50 2015 -0700 +++ b/mercurial/discovery.py Mon Oct 12 00:45:24 2015 -0700 @@ -305,7 +305,9 @@ candidate_newhs.update(unsyncedheads) dhs = None # delta heads, the new heads on branch discardedheads = set() - if repo.obsstore: + if not repo.obsstore: + newhs = candidate_newhs + else: # remove future heads which are actually obsoleted by another # pushed element: # @@ -334,8 +336,6 @@ break else: newhs.add(nh) - else: - newhs = candidate_newhs unsynced = sorted(h for h in unsyncedheads if h not in discardedheads) if unsynced: if None in unsynced: