##// END OF EJS Templates
shelve: find shelvedctx from bundle even if they are already in the repo...
Boris Feld -
r39925:d9ba836f default
parent child Browse files
Show More
@@ -144,11 +144,17 b' class shelvedfile(object):'
144 if not phases.supportinternal(self.repo):
144 if not phases.supportinternal(self.repo):
145 targetphase = phases.secret
145 targetphase = phases.secret
146 gen = exchange.readbundle(self.repo.ui, fp, self.fname, self.vfs)
146 gen = exchange.readbundle(self.repo.ui, fp, self.fname, self.vfs)
147 bundle2.applybundle(self.repo, gen, self.repo.currenttransaction(),
147 pretip = self.repo['tip']
148 tr = self.repo.currenttransaction()
149 bundle2.applybundle(self.repo, gen, tr,
148 source='unshelve',
150 source='unshelve',
149 url='bundle:' + self.vfs.join(self.fname),
151 url='bundle:' + self.vfs.join(self.fname),
150 targetphase=targetphase)
152 targetphase=targetphase)
151 return self.repo['tip']
153 shelvectx = self.repo['tip']
154 if pretip == shelvectx:
155 shelverev = tr.changes['revduplicates'][-1]
156 shelvectx = self.repo[shelverev]
157 return shelvectx
152 finally:
158 finally:
153 fp.close()
159 fp.close()
154
160
@@ -1858,16 +1858,34 b' mercurial does not crash'
1858
1858
1859 #if phasebased
1859 #if phasebased
1860
1860
1861 Unshelve without .shelve metadata:
1861 Unshelve with some metadata file missing
1862 ----------------------------------------
1862
1863
1863 $ hg shelve
1864 $ hg shelve
1864 shelved as default
1865 shelved as default
1865 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1866 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1867 $ echo 3 > a
1868
1869 Test with the `.shelve` missing, but the changeset still in the repo (non-natural case)
1870
1871 $ rm .hg/shelved/default.shelve
1872 $ hg unshelve
1873 unshelving change 'default'
1874 temporarily committing pending changes (restore with 'hg unshelve --abort')
1875 rebasing shelved changes
1876 merging a
1877 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
1878 unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue')
1879 [1]
1880 $ hg unshelve --abort
1881 unshelve of 'default' aborted
1882
1883 Unshelve without .shelve metadata (can happen when upgrading a repository with old shelve)
1884
1866 $ cat .hg/shelved/default.shelve
1885 $ cat .hg/shelved/default.shelve
1867 node=82e0cb9893247d12667017593ce1e5655860f1ac
1886 node=82e0cb9893247d12667017593ce1e5655860f1ac
1868 $ hg strip --hidden --rev 82e0cb989324 --no-backup
1887 $ hg strip --hidden --rev 82e0cb989324 --no-backup
1869 $ rm .hg/shelved/default.shelve
1888 $ rm .hg/shelved/default.shelve
1870 $ echo 3 > a
1871 $ hg unshelve
1889 $ hg unshelve
1872 unshelving change 'default'
1890 unshelving change 'default'
1873 temporarily committing pending changes (restore with 'hg unshelve --abort')
1891 temporarily committing pending changes (restore with 'hg unshelve --abort')
@@ -1878,6 +1896,8 b' Unshelve without .shelve metadata:'
1878 [1]
1896 [1]
1879 $ cat .hg/shelved/default.shelve
1897 $ cat .hg/shelved/default.shelve
1880 node=82e0cb9893247d12667017593ce1e5655860f1ac
1898 node=82e0cb9893247d12667017593ce1e5655860f1ac
1899 $ hg unshelve --abort
1900 unshelve of 'default' aborted
1881
1901
1882 #endif
1902 #endif
1883
1903
General Comments 0
You need to be logged in to leave comments. Login now