tests/test-amend.t
branchstable
changeset 3088 b3efdd407f30
parent 3013 945a0989e41b
child 3105 f5d472b7e800
child 3221 9f3521cc4c90
equal deleted inserted replaced
3077:b76fe277cef2 3088:b3efdd407f30
    19   marked working directory as branch foo
    19   marked working directory as branch foo
    20   (branches are permanent and global, did you want a bookmark?)
    20   (branches are permanent and global, did you want a bookmark?)
    21   $ hg amend -d '0 0'
    21   $ hg amend -d '0 0'
    22   $ hg debugobsolete
    22   $ hg debugobsolete
    23   07f4944404050f47db2e5c5071e0e84e7a27bba9 6a022cbb61d5ba0f03f98ff2d36319dfea1034ae 0 (*) {'ef1': '*', 'user': 'test'} (glob)
    23   07f4944404050f47db2e5c5071e0e84e7a27bba9 6a022cbb61d5ba0f03f98ff2d36319dfea1034ae 0 (*) {'ef1': '*', 'user': 'test'} (glob)
    24   b2e32ffb533cbe1d5759638c0cd4e8abc43b2738 0 {07f4944404050f47db2e5c5071e0e84e7a27bba9} (*) {'ef1': '*', 'user': 'test'} (glob)
       
    25   $ hg branch
    24   $ hg branch
    26   foo
    25   foo
    27   $ hg branches
    26   $ hg branches
    28   foo                            2:6a022cbb61d5
    27   foo                            1:6a022cbb61d5
    29   $ glog
    28   $ glog
    30   @  2@foo(draft) adda
    29   @  1@foo(draft) adda
    31   
    30   
    32 Test no-op
    31 Test no-op
    33 
    32 
    34   $ hg amend -d '0 0'
    33   $ hg amend -d '0 0'
    35   nothing changed
    34   nothing changed
    36   [1]
    35   [1]
    37   $ glog
    36   $ glog
    38   @  2@foo(draft) adda
    37   @  1@foo(draft) adda
    39   
    38   
    40 
    39 
    41 Test forcing the message to the same value, no intermediate revision.
    40 Test forcing the message to the same value, no intermediate revision.
    42 
    41 
    43   $ hg amend -d '0 0' -m 'adda'
    42   $ hg amend -d '0 0' -m 'adda'
    44   nothing changed
    43   nothing changed
    45   [1]
    44   [1]
    46   $ glog
    45   $ glog
    47   @  2@foo(draft) adda
    46   @  1@foo(draft) adda
    48   
    47   
    49 
    48 
    50 Test collapsing into an existing revision, no intermediate revision.
    49 Test collapsing into an existing revision, no intermediate revision.
    51 
    50 
    52   $ echo a >> a
    51   $ echo a >> a
    64   -a
    63   -a
    65   $ hg pdiff
    64   $ hg pdiff
    66   $ hg ci -m reseta
    65   $ hg ci -m reseta
    67   $ hg debugobsolete
    66   $ hg debugobsolete
    68   07f4944404050f47db2e5c5071e0e84e7a27bba9 6a022cbb61d5ba0f03f98ff2d36319dfea1034ae 0 (*) {'ef1': '*', 'user': 'test'} (glob)
    67   07f4944404050f47db2e5c5071e0e84e7a27bba9 6a022cbb61d5ba0f03f98ff2d36319dfea1034ae 0 (*) {'ef1': '*', 'user': 'test'} (glob)
    69   b2e32ffb533cbe1d5759638c0cd4e8abc43b2738 0 {07f4944404050f47db2e5c5071e0e84e7a27bba9} (*) {'ef1': '*', 'user': 'test'} (glob)
       
    70   $ hg phase 2
    68   $ hg phase 2
    71   2: draft
    69   2: draft
    72   $ glog
    70   $ glog
    73   @  4@foo(draft) reseta
    71   @  3@foo(draft) reseta
    74   |
    72   |
    75   o  3@foo(draft) changea
    73   o  2@foo(draft) changea
    76   |
    74   |
    77   o  2@foo(draft) adda
    75   o  1@foo(draft) adda
    78   
    76   
    79 Specify precise commit date with -d
    77 Specify precise commit date with -d
    80   $ hg amend -d '2001-02-03 04:05:06 +0700'
    78   $ hg amend -d '2001-02-03 04:05:06 +0700'
    81   $ hg parents --template '{rev}  {date|date}\n'
    79   $ hg parents --template '{rev}  {date|date}\n'
    82   5  Sat Feb 03 04:05:06 2001 +0700
    80   4  Sat Feb 03 04:05:06 2001 +0700
    83 
    81 
    84 Specify "now" as commit date with -D
    82 Specify "now" as commit date with -D
    85   $ before=`date +%s`
    83   $ before=`date +%s`
    86   $ hg amend -D
    84   $ hg amend -D
    87   $ commit=`hg parents --template '{date|hgdate} rev{rev}\n'`
    85   $ commit=`hg parents --template '{date|hgdate} rev{rev}\n'`
    88   $ after=`date +%s`
    86   $ after=`date +%s`
    89   $ (echo $before ; echo $commit; echo $after) | sort -k1 -n -s
    87   $ (echo $before ; echo $commit; echo $after) | sort -k1 -n -s
    90   \d+ (re)
    88   \d+ (re)
    91   \d+ 0 rev6 (re)
    89   \d+ 0 rev5 (re)
    92   \d+ (re)
    90   \d+ (re)
    93 
    91 
    94 Specify current user as committer with -U
    92 Specify current user as committer with -U
    95   $ HGUSER=newbie hg amend -U
    93   $ HGUSER=newbie hg amend -U
    96   $ hg parents --template '{rev}  {author}\n'
    94   $ hg parents --template '{rev}  {author}\n'
    97   7  newbie
    95   6  newbie
    98 
    96 
    99 Check that --logfile works
    97 Check that --logfile works
   100   $ echo "logfile message" > logfile.txt
    98   $ echo "logfile message" > logfile.txt
   101   $ hg amend -l logfile.txt
    99   $ hg amend -l logfile.txt
   102   $ hg log -r . -T "{desc}\n"
   100   $ hg log -r . -T "{desc}\n"
   107   $ hg amend -e --config ui.username= -m "empty user"
   105   $ hg amend -e --config ui.username= -m "empty user"
   108   abort: no username supplied
   106   abort: no username supplied
   109   (use 'hg config --edit' to set your username)
   107   (use 'hg config --edit' to set your username)
   110   [255]
   108   [255]
   111   $ hg sum
   109   $ hg sum
   112   parent: 8:* tip (glob)
   110   parent: 7:* tip (glob)
   113    logfile message
   111    logfile message
   114   branch: foo
   112   branch: foo
   115   commit: 1 unknown (clean)
   113   commit: 1 unknown (clean)
   116   update: (current)
   114   update: (current)
   117   phases: 3 draft
   115   phases: 3 draft