Skip to content

Commit c9e5203

Browse files
zzl0facebook-github-bot
authored andcommitted
pullcreatemarkers: move checklocalrevisions close to its usages
Summary: Move checklocalrevisions close to its usages, this will avoid unnecessary computation and improves readability. Reviewed By: quark-zju Differential Revision: D40940473 fbshipit-source-id: 97e94bbcad468721175c846440ec525515139745
1 parent 170dfa6 commit c9e5203

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

eden/scm/edenscm/ext/pullcreatemarkers.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,6 @@ def _cleanuplanded(repo, dryrun=False):
102102
checklocalversions = ui.configbool("pullcreatemarkers", "check-local-versions")
103103
for diffid, draftnodes in sorted(difftodraft.items()):
104104
publicnode = difftopublic.get(diffid)
105-
if checklocalversions:
106-
draftnodes = draftnodes & difftolocal.get(diffid, set())
107105
if publicnode is None or publicnode not in unfi:
108106
continue
109107
# skip it if the local repo does not think it's a public commit.
@@ -112,6 +110,9 @@ def _cleanuplanded(repo, dryrun=False):
112110
# sanity check - the public commit should have a sane commit message.
113111
if diffprops.parserevfromcommitmsg(unfi[publicnode].description()) != diffid:
114112
continue
113+
114+
if checklocalversions:
115+
draftnodes = draftnodes & difftolocal.get(diffid, set())
115116
draftnodestr = ", ".join(
116117
short(d) for d in sorted(draftnodes)
117118
) # making output deterministic

0 commit comments

Comments
 (0)