[PATCH 1 of 3] amend: in tests, do not rely on defaults -- always use explicit -d

Greg Ward greg at gerg.ca
Fri Jun 6 01:33:58 UTC 2014


# HG changeset patch
# User Greg Ward <greg at gerg.ca>
# Date 1402018026 14400
#      Thu Jun 05 21:27:06 2014 -0400
# Node ID b3c700f75ac23420373129501bef302a3b687fcb
# Parent  f889409bdcc30356b8dacc1cee9bdf6c8181b993
amend: in tests, do not rely on defaults -- always use explicit -d

Having a default -d option will make it hard to test
-D/--current-date, which is coming shortly: presence of -d overrides
-D, just like with mq's qrefresh.

diff --git a/tests/test-amend.t b/tests/test-amend.t
--- a/tests/test-amend.t
+++ b/tests/test-amend.t
@@ -1,6 +1,4 @@
   $ cat >> $HGRCPATH <<EOF
-  > [defaults]
-  > amend=-d "0 0"
   > [extensions]
   > hgext.rebase=
   > hgext.graphlog=
@@ -22,7 +20,7 @@
   $ 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


More information about the Mercurial-devel mailing list