tests/test-amend.t
changeset 265 24943df310d4
parent 263 de62daaf2054
child 273 87e4d1eec5e8
equal deleted inserted replaced
264:1c21865bf8ba 265:24943df310d4
     5   > hgext.rebase=
     5   > hgext.rebase=
     6   > hgext.graphlog=
     6   > hgext.graphlog=
     7   > EOF
     7   > EOF
     8   $ echo "obsolete=$(echo $(dirname $TESTDIR))/hgext/obsolete.py" >> $HGRCPATH
     8   $ echo "obsolete=$(echo $(dirname $TESTDIR))/hgext/obsolete.py" >> $HGRCPATH
     9   $ echo "evolve=$(echo $(dirname $TESTDIR))/hgext/evolve.py" >> $HGRCPATH
     9   $ echo "evolve=$(echo $(dirname $TESTDIR))/hgext/evolve.py" >> $HGRCPATH
       
    10 
       
    11   $ glog() {
       
    12   >   hg glog --template '{rev}@{branch}({phase}) {desc|firstline}\n' "$@"
       
    13   > }
    10 
    14 
    11   $ hg init repo
    15   $ hg init repo
    12   $ cd repo
    16   $ cd repo
    13   $ echo a > a
    17   $ echo a > a
    14   $ hg ci -Am adda
    18   $ hg ci -Am adda
    23   $ hg branch
    27   $ hg branch
    24   foo
    28   foo
    25   $ hg branches
    29   $ hg branches
    26   foo                            2:a34b93d251e4
    30   foo                            2:a34b93d251e4
    27   default                        0:07f494440405 (inactive)
    31   default                        0:07f494440405 (inactive)
    28   $ hg glog --template '{rev}@{branch} {desc|firstline}\n'
    32   $ glog
    29   @  2@foo adda
    33   @  2@foo(draft) adda
       
    34   
       
    35 Test no-op
       
    36 
       
    37   $ hg amend
       
    38   abort: no updates found
       
    39   [255]
       
    40   $ glog
       
    41   @  2@foo(draft) adda
    30   
    42   
    31 
    43 
       
    44 Test forcing the message to the same value, no intermediate revision.
       
    45 
       
    46   $ hg amend -m 'adda'
       
    47   abort: no updates found
       
    48   [255]
       
    49   $ glog
       
    50   @  2@foo(draft) adda
       
    51   
       
    52 
       
    53 Test collapsing into an existing revision, no intermediate revision.
       
    54 
       
    55   $ echo a >> a
       
    56   $ hg ci -m changea
       
    57   $ echo a > a
       
    58   $ hg ci -m reseta
       
    59   $ hg amend --change 2
       
    60   abort: no updates found
       
    61   [255]
       
    62   $ hg phase 2
       
    63   2: draft
       
    64   $ glog
       
    65   @  4@foo(draft) reseta
       
    66   |
       
    67   o  3@foo(draft) changea
       
    68   |
       
    69   o  2@foo(draft) adda
       
    70   
       
    71 
       
    72 Test collapsing into an existing rev, with an intermediate revision.
       
    73 
       
    74   $ hg branch --force default
       
    75   marked working directory as branch default
       
    76   (branches are permanent and global, did you want a bookmark?)
       
    77   $ hg ci -m resetbranch
       
    78   created new head
       
    79   $ hg branch --force foo
       
    80   marked working directory as branch foo
       
    81   (branches are permanent and global, did you want a bookmark?)
       
    82   $ hg amend --change 2
       
    83   abort: no updates found
       
    84   [255]
       
    85   $ glog
       
    86   @  6@foo(secret) amends a34b93d251e49c93d5685ebacad785c73a7e8605
       
    87   |
       
    88   o  5@default(draft) resetbranch
       
    89   |
       
    90   o  4@foo(draft) reseta
       
    91   |
       
    92   o  3@foo(draft) changea
       
    93   |
       
    94   o  2@foo(draft) adda
       
    95