changeset 20150:11dbc38cebc6 stable

unshelve: add tests for unknown files Adds a basic test for shelving/unshelving with an unknown file present. Adds a test for unshelving on top of an existing unknown file.
author Durham Goode <durham@fb.com>
date Tue, 26 Nov 2013 16:30:52 -0800
parents 578b888c820e
children 734ff413eb7e
files tests/test-shelve.t
diffstat 1 files changed, 38 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-shelve.t	Tue Nov 26 16:23:05 2013 -0800
+++ b/tests/test-shelve.t	Tue Nov 26 16:30:52 2013 -0800
@@ -539,4 +539,42 @@
   adding file changes
   added 1 changesets with 1 changes to 2 files (+1 heads)
 
+unshelve should leave unknown files alone (issue4113)
+
+  $ echo e > e
+  $ hg shelve
+  shelved as default
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ hg status
+  ? e
+  $ hg unshelve
+  unshelving change 'default'
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 2 files (+1 heads)
+  $ hg status
+  A d
+  ? e
+  $ cat e
+  e
+
+unshelve should keep a copy of unknown files
+
+  $ hg add e
+  $ hg shelve
+  shelved as default
+  0 files updated, 0 files merged, 2 files removed, 0 files unresolved
+  $ echo z > e
+  $ hg unshelve
+  unshelving change 'default'
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 2 changes to 3 files (+1 heads)
+  $ cat e
+  e
+  $ cat e.orig
+  z
+
   $ cd ..