Patchwork [V2] shelve: unshelve using an unfiltered repository

login
register
mail settings
Submitter David Soria Parra
Date Nov. 11, 2013, 9:08 p.m.
Message ID <a83d7363636f17045856.1384204131@davidsp-mbp.local>
Download mbox | patch
Permalink /patch/2908/
State Accepted
Commit 99c4b8f79324ad2ca00bf08228c87a2b40cec2af
Headers show

Comments

David Soria Parra - Nov. 11, 2013, 9:08 p.m.
# HG changeset patch
# User David Soria Parra <davidsp@fb.com>
# Date 1383885386 28800
#      Thu Nov 07 20:36:26 2013 -0800
# Node ID a83d7363636f170458562c1f37ab75b8557b388b
# Parent  aa80446aacc3b1574211649cd8f190250b6b04b3
shelve: unshelve using an unfiltered repository

when evolve is enabled and a hidden obsolete changeset exists
in the repository, the strip during unshelve will fail due to
filtered revs. we use an unfiltered repository like to
repair.strip to strip the proper nodes.
Matt Mackall - Nov. 16, 2013, 8:45 p.m.
On Mon, 2013-11-11 at 13:08 -0800, David Soria Parra wrote:
> # HG changeset patch
> # User David Soria Parra <davidsp@fb.com>
> # Date 1383885386 28800
> #      Thu Nov 07 20:36:26 2013 -0800
> # Node ID a83d7363636f170458562c1f37ab75b8557b388b
> # Parent  aa80446aacc3b1574211649cd8f190250b6b04b3
> shelve: unshelve using an unfiltered repository

Queued for stable, thanks.

Patch

diff -r aa80446aacc3 -r a83d7363636f hgext/shelve.py
--- a/hgext/shelve.py	Wed Nov 06 12:53:39 2013 -0500
+++ b/hgext/shelve.py	Thu Nov 07 20:36:26 2013 -0800
@@ -610,7 +610,7 @@ 
         # but it doesn't update the inmemory structures, so addchangegroup
         # hooks still fire and try to operate on the missing commits.
         # Clean up manually to prevent this.
-        repo.changelog.strip(oldtiprev, tr)
+        repo.unfiltered().changelog.strip(oldtiprev, tr)
 
         unshelvecleanup(ui, repo, basename, opts)
     finally:
diff -r aa80446aacc3 -r a83d7363636f tests/test-shelve.t
--- a/tests/test-shelve.t	Wed Nov 06 12:53:39 2013 -0500
+++ b/tests/test-shelve.t	Thu Nov 07 20:36:26 2013 -0800
@@ -520,4 +520,23 @@ 
   $ hg status
   A d
 
+test bug 4073 we need to enable obsolete markers for it
+
+  $ cat > ../obs.py << EOF
+  > import mercurial.obsolete
+  > mercurial.obsolete._enabled = True
+  > EOF
+  $ echo '[extensions]' >> $HGRCPATH
+  $ echo "obs=${TESTTMP}/obs.py" >> $HGRCPATH
+  $ hg shelve
+  shelved as default
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ hg debugobsolete `hg --debug id -i -r 1`
+  $ hg unshelve
+  unshelving change 'default'
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 2 files (+1 heads)
+
   $ cd ..