changeset 49428:cc7eb0b558c0

phase-shelve: expand the tests to capture use-cases supported
author Jason R. Coombs <jaraco@jaraco.com>
date Tue, 02 Aug 2022 10:29:05 -0400
parents c4417029e6c2
children fa00c407d61c
files tests/test-shelve.t
diffstat 1 files changed, 40 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-shelve.t	Thu Jul 28 13:17:36 2022 -0400
+++ b/tests/test-shelve.t	Tue Aug 02 10:29:05 2022 -0400
@@ -1535,3 +1535,43 @@
   $ hg patch -p1 test_patch.patch
   applying test_patch.patch
 #endif
+
+-- if phasebased, shelve works without patch and bundle
+
+  $ hg update -q --clean .
+  $ hg strip -q -r 0
+  $ rm -r .hg/shelve*
+  $ echo import antigravity >> somefile.py
+  $ hg add somefile.py
+  $ hg shelve -q
+#if phasebased
+  $ rm .hg/shelved/default.hg
+  $ rm .hg/shelved/default.patch
+#endif
+
+shelve --list --patch should work even with no patch file.
+
+  $ hg shelve --list --patch
+  default         (*s ago) * (changes in empty repository) (glob)
+  
+  diff --git a/somefile.py b/somefile.py
+  new file mode 100644
+  --- /dev/null
+  +++ b/somefile.py
+  @@ -0,0 +1,1 @@
+  +import antigravity
+
+  $ hg unshelve
+  unshelving change 'default'
+
+#if phasebased
+  $ ls .hg/shelve-backup
+  default.shelve
+#endif
+
+#if stripbased
+  $ ls .hg/shelve-backup
+  default.hg
+  default.patch
+  default.shelve
+#endif