mercurial/bundlerepo.py
changeset 23633 96c3cbec006f
parent 23632 e7fcf58acd71
child 23878 37a92908a382
equal deleted inserted replaced
23632:e7fcf58acd71 23633:96c3cbec006f
   348             repopath, bundlename = s
   348             repopath, bundlename = s
   349     else:
   349     else:
   350         repopath, bundlename = parentpath, path
   350         repopath, bundlename = parentpath, path
   351     return bundlerepository(ui, repopath, bundlename)
   351     return bundlerepository(ui, repopath, bundlename)
   352 
   352 
       
   353 class bundletransactionmanager(object):
       
   354     def transaction(self):
       
   355         return None
       
   356 
       
   357     def close(self):
       
   358         raise NotImplementedError
       
   359 
       
   360     def release(self):
       
   361         raise NotImplementedError
       
   362 
   353 def getremotechanges(ui, repo, other, onlyheads=None, bundlename=None,
   363 def getremotechanges(ui, repo, other, onlyheads=None, bundlename=None,
   354                      force=False):
   364                      force=False):
   355     '''obtains a bundle of changes incoming from other
   365     '''obtains a bundle of changes incoming from other
   356 
   366 
   357     "onlyheads" restricts the returned changes to those reachable from the
   367     "onlyheads" restricts the returned changes to those reachable from the
   416         # The discovery process probably need cleanup to avoid that
   426         # The discovery process probably need cleanup to avoid that
   417         localrepo = localrepo.unfiltered()
   427         localrepo = localrepo.unfiltered()
   418 
   428 
   419     csets = localrepo.changelog.findmissing(common, rheads)
   429     csets = localrepo.changelog.findmissing(common, rheads)
   420 
   430 
       
   431     if bundlerepo:
       
   432         reponodes = [ctx.node() for ctx in bundlerepo[bundlerepo.firstnewrev:]]
       
   433         remotephases = other.listkeys('phases')
       
   434 
       
   435         pullop = exchange.pulloperation(bundlerepo, other, heads=reponodes)
       
   436         pullop.trmanager = bundletransactionmanager()
       
   437         exchange._pullapplyphases(pullop, remotephases)
       
   438 
   421     def cleanup():
   439     def cleanup():
   422         if bundlerepo:
   440         if bundlerepo:
   423             bundlerepo.close()
   441             bundlerepo.close()
   424         if bundle:
   442         if bundle:
   425             os.unlink(bundle)
   443             os.unlink(bundle)