tests/test-oldconvert.t
author Pierre-Yves David <pierre-yves.david@logilab.fr>
Tue, 26 Jun 2012 18:23:30 +0200
changeset 316 3db377533c32
parent 224 f60555898df4
child 334 fb83210bce32
permissions -rw-r--r--
oops (forget to amend)

  $ cat >> $HGRCPATH <<EOF
  > [web]
  > push_ssl = false
  > allow_push = *
  > [phases]
  > publish=False
  > [alias]
  > odiff=diff --rev 'limit(obsparents(.),1)' --rev .
  > [extensions]
  > hgext.graphlog=
  > EOF
  $ mkcommit() {
  >    echo "$1" > "$1"
  >    hg add "$1"
  >    hg ci -m "add $1"
  > }

create commit

  $ hg init repo
  $ cd repo
  $ mkcommit a
  $ mkcommit b
  $ hg up -q 0
  $ mkcommit c
  created new head

forge old style relation files

  $ hg log -r 2 --template='{node} ' > .hg/obsolete-relations
  $ hg log -r 1 --template='{node}' >> .hg/obsolete-relations

enable the extensions

  $ echo "obsolete=$(echo $(dirname $TESTDIR))/hgext/obsolete.py" >> $HGRCPATH

  $ hg glog
  abort: old format of obsolete marker detected!
  run `hg debugconvertobsolete` once.
  [255]
  $ hg debugconvertobsolete --traceback
  1 obsolete marker converted
  $ hg glog
  @  changeset:   2:d67cd0334eee
  |  tag:         tip
  |  parent:      0:1f0dee641bb7
  |  user:        test
  |  date:        Thu Jan 01 00:00:00 1970 +0000
  |  summary:     add c
  |
  o  changeset:   0:1f0dee641bb7
     user:        test
     date:        Thu Jan 01 00:00:00 1970 +0000
     summary:     add a
  
  $ hg debugconvertobsolete
  nothing to do
  0 obsolete marker converted