hgext/narrow/narrowbundle2.py
changeset 50928 d718eddf01d9
parent 50301 d89eecf9605e
equal deleted inserted replaced
50927:7a8ea1397816 50928:d718eddf01d9
   257             op._widen_bundle = chgrpfile
   257             op._widen_bundle = chgrpfile
   258     # Set the new narrowspec if we're widening. The setnewnarrowpats() method
   258     # Set the new narrowspec if we're widening. The setnewnarrowpats() method
   259     # will currently always be there when using the core+narrowhg server, but
   259     # will currently always be there when using the core+narrowhg server, but
   260     # other servers may include a changespec part even when not widening (e.g.
   260     # other servers may include a changespec part even when not widening (e.g.
   261     # because we're deepening a shallow repo).
   261     # because we're deepening a shallow repo).
   262     if util.safehasattr(repo, 'setnewnarrowpats'):
   262     if hasattr(repo, 'setnewnarrowpats'):
   263         op.gettransaction()
   263         op.gettransaction()
   264         repo.setnewnarrowpats()
   264         repo.setnewnarrowpats()
   265 
   265 
   266 
   266 
   267 def handlechangegroup_widen(op, inpart):
   267 def handlechangegroup_widen(op, inpart):
   331     # Extend changegroup receiver so client can fixup after widen requests.
   331     # Extend changegroup receiver so client can fixup after widen requests.
   332     origcghandler = bundle2.parthandlermapping[b'changegroup']
   332     origcghandler = bundle2.parthandlermapping[b'changegroup']
   333 
   333 
   334     def wrappedcghandler(op, inpart):
   334     def wrappedcghandler(op, inpart):
   335         origcghandler(op, inpart)
   335         origcghandler(op, inpart)
   336         if util.safehasattr(op, '_widen_bundle'):
   336         if hasattr(op, '_widen_bundle'):
   337             handlechangegroup_widen(op, inpart)
   337             handlechangegroup_widen(op, inpart)
   338         if util.safehasattr(op, '_bookmarksbackup'):
   338         if hasattr(op, '_bookmarksbackup'):
   339             localrepo.localrepository._bookmarks.set(
   339             localrepo.localrepository._bookmarks.set(
   340                 op.repo, op._bookmarksbackup
   340                 op.repo, op._bookmarksbackup
   341             )
   341             )
   342             del op._bookmarksbackup
   342             del op._bookmarksbackup
   343 
   343