tests/test-amend.t
branchstable
changeset 1048 a585353a816b
parent 985 6a37044ec0b3
child 1065 f355bbc124fc
--- a/tests/test-amend.t	Fri Aug 08 15:50:26 2014 -0700
+++ b/tests/test-amend.t	Fri Aug 08 23:14:00 2014 -0700
@@ -1,6 +1,4 @@
   $ cat >> $HGRCPATH <<EOF
-  > [defaults]
-  > amend=-d "0 0"
   > [extensions]
   > hgext.rebase=
   > hgext.graphlog=
@@ -17,12 +15,12 @@
   $ hg ci -Am adda
   adding a
 
-Test amend captures branches
+Test that amend captures branches
 
   $ hg branch foo
   marked working directory as branch foo
   (branches are permanent and global, did you want a bookmark?)
-  $ hg amend
+  $ hg amend -d '0 0'
   $ hg debugobsolete
   07f4944404050f47db2e5c5071e0e84e7a27bba9 6a022cbb61d5ba0f03f98ff2d36319dfea1034ae 0 {'date': '* *', 'user': 'test'} (glob)
   b2e32ffb533cbe1d5759638c0cd4e8abc43b2738 0 {'date': '* *', 'user': 'test'} (glob)
@@ -35,7 +33,7 @@
   
 Test no-op
 
-  $ hg amend
+  $ hg amend -d '0 0'
   nothing changed
   [1]
   $ glog
@@ -44,7 +42,7 @@
 
 Test forcing the message to the same value, no intermediate revision.
 
-  $ hg amend -m 'adda'
+  $ hg amend -d '0 0' -m 'adda'
   nothing changed
   [1]
   $ glog
@@ -80,4 +78,22 @@
   |
   o  2@foo(draft) adda
   
+Specify precise commit date with -d
+  $ hg amend -d '2001-02-03 04:05:06 +0700'
+  $ hg parents --template '{rev}  {date|date}\n'
+  5  Sat Feb 03 04:05:06 2001 +0700
 
+Specify "now" as commit date with -D
+  $ before=`date +%s`
+  $ hg amend -D
+  $ commit=`hg parents --template '{date|hgdate} rev{rev}\n'`
+  $ after=`date +%s`
+  $ (echo $before ; echo $commit; echo $after) | sort -k1 -n -s
+  \d+ (re)
+  \d+ 0 rev6 (re)
+  \d+ (re)
+
+Specify current user as committer with -U
+  $ HGUSER=newbie hg amend -U
+  $ hg parents --template '{rev}  {author}\n'
+  7  newbie