Patchwork [1,of,5] tests: add test for updating to null revision

login
register
mail settings
Submitter via Mercurial-devel
Date Feb. 10, 2017, 6 a.m.
Message ID <14817ea5de6a92ef99fd.1486706428@martinvonz.mtv.corp.google.com>
Download mbox | patch
Permalink /patch/18386/
State Accepted
Delegated to: Sean Farley
Headers show

Comments

via Mercurial-devel - Feb. 10, 2017, 6 a.m.
# HG changeset patch
# User Martin von Zweigbergk <martinvonz@google.com>
# Date 1486620747 28800
#      Wed Feb 08 22:12:27 2017 -0800
# Node ID 14817ea5de6a92ef99fd4b5983e5a644c8fcb170
# Parent  1f51b4658f21bbb797e922d155c1046eddccf91d
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.

Patch

diff -r 1f51b4658f21 -r 14817ea5de6a tests/test-update-branches.t
--- a/tests/test-update-branches.t	Thu Feb 02 14:19:48 2017 +0100
+++ 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
 ---------------------------------------------------------------------