Mercurial > hg
diff tests/test-shelve.t @ 39889:d9ba836fc234
shelve: find shelvedctx from bundle even if they are already in the repo
We use the new "duplicates" node tracking to find the tip of the bundle even if
it already exists in the repository.
Such logic is not supposed to be needed in theory. If the shelve was made using
internal-phase, we already know its node. Otherwise, the bundle content should
have been stripped. However, handling it makes the shelve code more robust and
provide a good example of "revduplicates" usage.
author | Boris Feld <boris.feld@octobus.net> |
---|---|
date | Thu, 20 Sep 2018 17:47:05 +0200 |
parents | 4675c122157e |
children | 1b836cee2d91 |
line wrap: on
line diff
--- a/tests/test-shelve.t Wed Sep 19 12:19:28 2018 +0200 +++ b/tests/test-shelve.t Thu Sep 20 17:47:05 2018 +0200 @@ -1858,16 +1858,34 @@ #if phasebased -Unshelve without .shelve metadata: +Unshelve with some metadata file missing +---------------------------------------- $ hg shelve shelved as default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved + $ echo 3 > a + +Test with the `.shelve` missing, but the changeset still in the repo (non-natural case) + + $ rm .hg/shelved/default.shelve + $ hg unshelve + unshelving change 'default' + temporarily committing pending changes (restore with 'hg unshelve --abort') + rebasing shelved changes + merging a + warning: conflicts while merging a! (edit, then use 'hg resolve --mark') + unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue') + [1] + $ hg unshelve --abort + unshelve of 'default' aborted + +Unshelve without .shelve metadata (can happen when upgrading a repository with old shelve) + $ cat .hg/shelved/default.shelve node=82e0cb9893247d12667017593ce1e5655860f1ac $ hg strip --hidden --rev 82e0cb989324 --no-backup $ rm .hg/shelved/default.shelve - $ echo 3 > a $ hg unshelve unshelving change 'default' temporarily committing pending changes (restore with 'hg unshelve --abort') @@ -1878,6 +1896,8 @@ [1] $ cat .hg/shelved/default.shelve node=82e0cb9893247d12667017593ce1e5655860f1ac + $ hg unshelve --abort + unshelve of 'default' aborted #endif