From 3d4a5a6d7e7d59b48bb6bfe61e30c7f6ae1e2f06 Mon Sep 17 00:00:00 2001 From: Felipe Contreras Date: Tue, 18 Jun 2019 15:22:09 -0500 Subject: [PATCH] Trivial cleanup By adding a helper function the code is more understandable. No functional changes. Signed-off-by: Felipe Contreras --- git-remote-hg | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/git-remote-hg b/git-remote-hg index e3afa97..0fd487d 100755 --- a/git-remote-hg +++ b/git-remote-hg @@ -1146,6 +1146,10 @@ def check_tip(ref, kind, name, heads): else: return tip in heads +def bookmark_is_fake(bmark, real_bmarks): + return bmark == fake_bmark or \ + (bmark == 'master' and bmark not in real_bmarks) + def do_export(parser): p_bmarks = [] p_revs = {} @@ -1196,8 +1200,7 @@ def do_export(parser): continue print "ok %s" % ref - if bmark != fake_bmark and \ - not (bmark == 'master' and bmark not in parser.repo._bookmarks): + if not bookmark_is_fake(bmark, parser.repo._bookmarks): p_bmarks.append((ref, bmark, old, new)) if peer: