177 _('unexpected changespec node chunk type: %s') % chunksignal) |
178 _('unexpected changespec node chunk type: %s') % chunksignal) |
178 chunksignal = changegroup.readexactly(inpart, 4) |
179 chunksignal = changegroup.readexactly(inpart, 4) |
179 |
180 |
180 if clkills: |
181 if clkills: |
181 # preserve bookmarks that repair.strip() would otherwise strip |
182 # preserve bookmarks that repair.strip() would otherwise strip |
182 bmstore = repo._bookmarks |
183 op._bookmarksbackup = repo._bookmarks |
183 class dummybmstore(dict): |
184 class dummybmstore(dict): |
184 def applychanges(self, repo, tr, changes): |
185 def applychanges(self, repo, tr, changes): |
185 pass |
186 pass |
186 repo._bookmarks = dummybmstore() |
187 localrepo.localrepository._bookmarks.set(repo, dummybmstore()) |
187 chgrpfile = repair.strip(op.ui, repo, list(clkills), backup=True, |
188 chgrpfile = repair.strip(op.ui, repo, list(clkills), backup=True, |
188 topic='widen') |
189 topic='widen') |
189 repo._bookmarks = bmstore |
|
190 if chgrpfile: |
190 if chgrpfile: |
191 op._widen_uninterr = repo.ui.uninterruptable() |
191 op._widen_uninterr = repo.ui.uninterruptable() |
192 op._widen_uninterr.__enter__() |
192 op._widen_uninterr.__enter__() |
193 # presence of _widen_bundle attribute activates widen handler later |
193 # presence of _widen_bundle attribute activates widen handler later |
194 op._widen_bundle = chgrpfile |
194 op._widen_bundle = chgrpfile |
268 origcghandler = bundle2.parthandlermapping['changegroup'] |
268 origcghandler = bundle2.parthandlermapping['changegroup'] |
269 def wrappedcghandler(op, inpart): |
269 def wrappedcghandler(op, inpart): |
270 origcghandler(op, inpart) |
270 origcghandler(op, inpart) |
271 if util.safehasattr(op, '_widen_bundle'): |
271 if util.safehasattr(op, '_widen_bundle'): |
272 handlechangegroup_widen(op, inpart) |
272 handlechangegroup_widen(op, inpart) |
|
273 if util.safehasattr(op, '_bookmarksbackup'): |
|
274 localrepo.localrepository._bookmarks.set(op.repo, |
|
275 op._bookmarksbackup) |
|
276 del op._bookmarksbackup |
|
277 |
273 wrappedcghandler.params = origcghandler.params |
278 wrappedcghandler.params = origcghandler.params |
274 bundle2.parthandlermapping['changegroup'] = wrappedcghandler |
279 bundle2.parthandlermapping['changegroup'] = wrappedcghandler |