diff --git a/mercurial/exchange.py b/mercurial/exchange.py index 0c469df6e9149b8231b827f9ee3944e9cd52da22_bWVyY3VyaWFsL2V4Y2hhbmdlLnB5..f715cc0b5107c3cecf1e9600ab78263c9985c618_bWVyY3VyaWFsL2V4Y2hhbmdlLnB5 100644 --- a/mercurial/exchange.py +++ b/mercurial/exchange.py @@ -395,8 +395,23 @@ self._trname = 'pull\n' + util.hidepassword(remote.url()) # hold the transaction once created self._tr = None - # heads of the set of changeset target by the pull - self.pulledsubset = None + # set of common changeset between local and remote before pull + self.common = None + # set of pulled head + self.rheads = None + + @util.propertycache + def pulledsubset(self): + """heads of the set of changeset target by the pull""" + # compute target subset + if self.heads is None: + # We pulled every thing possible + # sync on everything common + return self.common + self.rheads + else: + # We pulled a specific subset + # sync on this subset + return self.heads def gettransaction(self): """get appropriate pull transaction, creating it if needed""" @@ -430,7 +445,7 @@ pullop.remote, heads=pullop.heads, force=force) - common, fetch, rheads = tmp + pullop.common, fetch, pullop.rheads = tmp if not fetch: pullop.repo.ui.status(_("no changes found\n")) result = 0 @@ -439,8 +454,8 @@ # don't open transaction for nothing or you break future useful # rollback call pullop.gettransaction() - if pullop.heads is None and list(common) == [nullid]: + if pullop.heads is None and list(pullop.common) == [nullid]: pullop.repo.ui.status(_("requesting all changes\n")) elif (pullop.heads is None and pullop.remote.capable('changegroupsubset')): # issue1320, avoid a race if remote changed after discovery @@ -443,8 +458,8 @@ pullop.repo.ui.status(_("requesting all changes\n")) elif (pullop.heads is None and pullop.remote.capable('changegroupsubset')): # issue1320, avoid a race if remote changed after discovery - pullop.heads = rheads + pullop.heads = pullop.rheads if pullop.remote.capable('getbundle'): # TODO: get bundlecaps from remote @@ -448,8 +463,10 @@ if pullop.remote.capable('getbundle'): # TODO: get bundlecaps from remote - cg = pullop.remote.getbundle('pull', common=common, - heads=pullop.heads or rheads) + cg = pullop.remote.getbundle('pull', + common=pullop.common, + heads=(pullop.heads + or pullop.rheads)) elif pullop.heads is None: cg = pullop.remote.changegroup(fetch, 'pull') elif not pullop.remote.capable('changegroupsubset'): @@ -462,17 +479,6 @@ result = pullop.repo.addchangegroup(cg, 'pull', pullop.remote.url()) - # compute target subset - if pullop.heads is None: - # We pulled every thing possible - # sync on everything common - subset = common + rheads - else: - # We pulled a specific subset - # sync on this subset - subset = pullop.heads - pullop.pulledsubset = subset - _pullphase(pullop) _pullobsolete(pullop) pullop.closetransaction()