Patchwork [2,of,2,V2,STABLE] unshelve: add tests for unknown files

login
register
mail settings
Submitter Durham Goode
Date Nov. 27, 2013, 12:43 a.m.
Message ID <62b1b8948f808fce2aa6.1385512989@dev350.prn1.facebook.com>
Download mbox | patch
Permalink /patch/3173/
State Accepted
Commit 11dbc38cebc6f4215fe2ae82468f50be1eabd809
Headers show

Comments

Durham Goode - Nov. 27, 2013, 12:43 a.m.
# HG changeset patch
# User Durham Goode <durham@fb.com>
# Date 1385512252 28800
#      Tue Nov 26 16:30:52 2013 -0800
# Branch stable
# Node ID 62b1b8948f808fce2aa68a6e2c7c403b48455884
# Parent  8b6d3738dee65def3b8c6db2fa0970bf4f31dc18
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.
Matt Mackall - Dec. 1, 2013, 7:06 p.m.
On Tue, 2013-11-26 at 16:43 -0800, Durham Goode wrote:
> # HG changeset patch
> # User Durham Goode <durham@fb.com>
> # Date 1385512252 28800
> #      Tue Nov 26 16:30:52 2013 -0800
> # Branch stable
> # Node ID 62b1b8948f808fce2aa68a6e2c7c403b48455884
> # Parent  8b6d3738dee65def3b8c6db2fa0970bf4f31dc18
> unshelve: add tests for unknown files

These are queued for stable, thanks.

Patch

diff --git a/tests/test-shelve.t b/tests/test-shelve.t
--- a/tests/test-shelve.t
+++ b/tests/test-shelve.t
@@ -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 ..