Patchwork D5398: narrow: keep bookmarks temporarily stripped for as long as commits are

login
register
mail settings
Submitter phabricator
Date Dec. 9, 2018, 12:06 p.m.
Message ID <7a8d9e72afaebb635baa598ff61b1efb@localhost.localdomain>
Download mbox | patch
Permalink /patch/37040/
State Not Applicable
Headers show

Comments

phabricator - Dec. 9, 2018, 12:06 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG109a267acc1e: narrow: keep bookmarks temporarily stripped for as long as commits are (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5398?vs=12760&id=12763

REVISION DETAIL
  https://phab.mercurial-scm.org/D5398

AFFECTED FILES
  hgext/narrow/narrowbundle2.py

CHANGE DETAILS




To: martinvonz, durin42, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/hgext/narrow/narrowbundle2.py b/hgext/narrow/narrowbundle2.py
--- a/hgext/narrow/narrowbundle2.py
+++ b/hgext/narrow/narrowbundle2.py
@@ -20,6 +20,7 @@ 
     changegroup,
     error,
     exchange,
+    localrepo,
     narrowspec,
     repair,
     repository,
@@ -179,14 +180,13 @@ 
 
     if clkills:
         # preserve bookmarks that repair.strip() would otherwise strip
-        bmstore = repo._bookmarks
+        op._bookmarksbackup = repo._bookmarks
         class dummybmstore(dict):
             def applychanges(self, repo, tr, changes):
                 pass
-        repo._bookmarks = dummybmstore()
+        localrepo.localrepository._bookmarks.set(repo, dummybmstore())
         chgrpfile = repair.strip(op.ui, repo, list(clkills), backup=True,
                                  topic='widen')
-        repo._bookmarks = bmstore
         if chgrpfile:
             op._widen_uninterr = repo.ui.uninterruptable()
             op._widen_uninterr.__enter__()
@@ -270,5 +270,10 @@ 
         origcghandler(op, inpart)
         if util.safehasattr(op, '_widen_bundle'):
             handlechangegroup_widen(op, inpart)
+        if util.safehasattr(op, '_bookmarksbackup'):
+            localrepo.localrepository._bookmarks.set(op.repo,
+                                                     op._bookmarksbackup)
+            del op._bookmarksbackup
+
     wrappedcghandler.params = origcghandler.params
     bundle2.parthandlermapping['changegroup'] = wrappedcghandler