tests/test-amend.t
author Patrick Mezard <patrick@mezard.eu>
Tue, 12 Jun 2012 11:14:02 +0200
changeset 263 de62daaf2054
child 265 24943df310d4
permissions -rw-r--r--
amend: drop --branches, pick it from working directory The amended changeset branch was picked either from --branch or from the first parent, but the actual working directory branch was ignored. The behaviour is changed so the amended revision branch is picked from the intermediate revision, which branch comes from the usual working directory rules. --branch is thus replaced by "hg branch".

  $ cat >> $HGRCPATH <<EOF
  > [defaults]
  > amend=-d "0 0"
  > [extensions]
  > hgext.rebase=
  > hgext.graphlog=
  > EOF
  $ echo "obsolete=$(echo $(dirname $TESTDIR))/hgext/obsolete.py" >> $HGRCPATH
  $ echo "evolve=$(echo $(dirname $TESTDIR))/hgext/evolve.py" >> $HGRCPATH

  $ hg init repo
  $ cd repo
  $ echo a > a
  $ hg ci -Am adda
  adding a

Test 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 branch
  foo
  $ hg branches
  foo                            2:a34b93d251e4
  default                        0:07f494440405 (inactive)
  $ hg glog --template '{rev}@{branch} {desc|firstline}\n'
  @  2@foo adda