changeset 30900:23eed7d423b4

tests: add test for updating to null revision While working on merge.py, I realized that we don't (as far as I could tell) have any tests for updating to the null revision with a dirty working copy. This adds some simple tests for that.
author Martin von Zweigbergk <martinvonz@google.com>
date Wed, 08 Feb 2017 22:12:27 -0800
parents a8786013f056
children 47278970fc8c
files tests/test-update-branches.t
diffstat 1 files changed, 22 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-update-branches.t	Fri Feb 10 15:26:03 2017 -0800
+++ b/tests/test-update-branches.t	Wed Feb 08 22:12:27 2017 -0800
@@ -177,6 +177,28 @@
 
   $ cd ..
 
+Test updating to null revision
+
+  $ hg init null-repo
+  $ cd null-repo
+  $ echo a > a
+  $ hg add a
+  $ hg ci -m a
+  $ hg up -qC 0
+  $ echo b > b
+  $ hg add b
+  $ hg up null
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ hg st
+  A b
+  $ hg up -q 0
+  $ hg st
+  A b
+  $ hg up -qC null
+  $ hg st
+  ? b
+  $ cd ..
+
 Test updating with closed head
 ---------------------------------------------------------------------