Comments
Patch
@@ -448,16 +448,11 @@ def pull(repo, remote, heads=None, force
tmp = discovery.findcommonincoming(pullop.repo.unfiltered(),
pullop.remote,
heads=pullop.heads,
force=force)
pullop.common, pullop.fetch, pullop.rheads = tmp
- if not pullop.fetch:
- pullop.repo.ui.status(_("no changes found\n"))
- pullop.cgresult = 0
- else:
- pullop.cgresult = _pullchangeset(pullop)
-
+ _pullchangeset(pullop)
_pullphase(pullop)
_pullobsolete(pullop)
pullop.closetransaction()
finally:
pullop.releasetransaction()
@@ -468,10 +463,14 @@ def pull(repo, remote, heads=None, force
def _pullchangeset(pullop):
"""pull changeset from unbundle into the local repo"""
# We delay the open of the transaction as late as possible so we
# don't open transaction for nothing or you break future useful
# rollback call
+ if not pullop.fetch:
+ pullop.repo.ui.status(_("no changes found\n"))
+ pullop.cgresult = 0
+ return
pullop.gettransaction()
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
@@ -487,11 +486,12 @@ def _pullchangeset(pullop):
raise util.Abort(_("partial pull cannot be done because "
"other repository doesn't support "
"changegroupsubset."))
else:
cg = pullop.remote.changegroupsubset(pullop.fetch, pullop.heads, 'pull')
- return pullop.repo.addchangegroup(cg, 'pull', pullop.remote.url())
+ pullop.cgresult = pullop.repo.addchangegroup(cg, 'pull',
+ pullop.remote.url())
def _pullphase(pullop):
# Get remote phases data from remote
remotephases = pullop.remote.listkeys('phases')
publishing = bool(remotephases.get('publishing', False))