tests/test-amend.t
changeset 5230 39d282fd04e0
parent 4988 588b3484c131
--- a/tests/test-amend.t	Fri Dec 20 14:08:37 2019 +0700
+++ b/tests/test-amend.t	Mon Nov 04 01:30:50 2019 +0530
@@ -121,6 +121,9 @@
   update: (current)
   phases: 3 draft
 
+setting the user after we have performed the test with no username
+  $ HGUSER=test
+
 Check the help
   $ hg amend -h
   hg amend [OPTION]... [FILE]...
@@ -170,3 +173,22 @@
   $ hg amend --patch --extract
   abort: cannot use both --patch and --extract
   [255]
+
+  $ cd ..
+
+Check the pre-check logic
+  $ hg init precheckrepo
+  $ cd precheckrepo
+  $ echo a > a
+  $ hg ci -Am "added a"
+  adding a
+  $ echo newchanges > a
+  $ hg amend
+  $ hg up 0 --hidden -q
+  updated to hidden changeset 9092f1db7931
+  (hidden revision '9092f1db7931' was rewritten as: aafaf407b00d)
+  working directory parent is obsolete! (9092f1db7931)
+  $ hg amend -m "i am gonna create divergence"
+  abort: revision being rewritten or one of its precursor was rewritten as aafaf407b00d, performing 'amend' will create content-divergence
+  (For more, see 'hg help evolution.instability')
+  [255]