tests/test-oldconvert.t
author Pierre-Yves.David@ens-lyon.org
Tue, 08 May 2012 20:50:43 +0200
changeset 224 f60555898df4
child 334 fb83210bce32
permissions -rw-r--r--
new obsolete store The new formats allows multiple "new" changeset and various meta-data. Forcing extinct to secret phase happen now on an irregular basis A command exist to migrate to the new format
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
224
f60555898df4 new obsolete store
Pierre-Yves.David@ens-lyon.org
parents:
diff changeset
     1
  $ cat >> $HGRCPATH <<EOF
f60555898df4 new obsolete store
Pierre-Yves.David@ens-lyon.org
parents:
diff changeset
     2
  > [web]
f60555898df4 new obsolete store
Pierre-Yves.David@ens-lyon.org
parents:
diff changeset
     3
  > push_ssl = false
f60555898df4 new obsolete store
Pierre-Yves.David@ens-lyon.org
parents:
diff changeset
     4
  > allow_push = *
f60555898df4 new obsolete store
Pierre-Yves.David@ens-lyon.org
parents:
diff changeset
     5
  > [phases]
f60555898df4 new obsolete store
Pierre-Yves.David@ens-lyon.org
parents:
diff changeset
     6
  > publish=False
f60555898df4 new obsolete store
Pierre-Yves.David@ens-lyon.org
parents:
diff changeset
     7
  > [alias]
f60555898df4 new obsolete store
Pierre-Yves.David@ens-lyon.org
parents:
diff changeset
     8
  > odiff=diff --rev 'limit(obsparents(.),1)' --rev .
f60555898df4 new obsolete store
Pierre-Yves.David@ens-lyon.org
parents:
diff changeset
     9
  > [extensions]
f60555898df4 new obsolete store
Pierre-Yves.David@ens-lyon.org
parents:
diff changeset
    10
  > hgext.graphlog=
f60555898df4 new obsolete store
Pierre-Yves.David@ens-lyon.org
parents:
diff changeset
    11
  > EOF
f60555898df4 new obsolete store
Pierre-Yves.David@ens-lyon.org
parents:
diff changeset
    12
  $ mkcommit() {
f60555898df4 new obsolete store
Pierre-Yves.David@ens-lyon.org
parents:
diff changeset
    13
  >    echo "$1" > "$1"
f60555898df4 new obsolete store
Pierre-Yves.David@ens-lyon.org
parents:
diff changeset
    14
  >    hg add "$1"
f60555898df4 new obsolete store
Pierre-Yves.David@ens-lyon.org
parents:
diff changeset
    15
  >    hg ci -m "add $1"
f60555898df4 new obsolete store
Pierre-Yves.David@ens-lyon.org
parents:
diff changeset
    16
  > }
f60555898df4 new obsolete store
Pierre-Yves.David@ens-lyon.org
parents:
diff changeset
    17
f60555898df4 new obsolete store
Pierre-Yves.David@ens-lyon.org
parents:
diff changeset
    18
create commit
f60555898df4 new obsolete store
Pierre-Yves.David@ens-lyon.org
parents:
diff changeset
    19
f60555898df4 new obsolete store
Pierre-Yves.David@ens-lyon.org
parents:
diff changeset
    20
  $ hg init repo
f60555898df4 new obsolete store
Pierre-Yves.David@ens-lyon.org
parents:
diff changeset
    21
  $ cd repo
f60555898df4 new obsolete store
Pierre-Yves.David@ens-lyon.org
parents:
diff changeset
    22
  $ mkcommit a
f60555898df4 new obsolete store
Pierre-Yves.David@ens-lyon.org
parents:
diff changeset
    23
  $ mkcommit b
f60555898df4 new obsolete store
Pierre-Yves.David@ens-lyon.org
parents:
diff changeset
    24
  $ hg up -q 0
f60555898df4 new obsolete store
Pierre-Yves.David@ens-lyon.org
parents:
diff changeset
    25
  $ mkcommit c
f60555898df4 new obsolete store
Pierre-Yves.David@ens-lyon.org
parents:
diff changeset
    26
  created new head
f60555898df4 new obsolete store
Pierre-Yves.David@ens-lyon.org
parents:
diff changeset
    27
f60555898df4 new obsolete store
Pierre-Yves.David@ens-lyon.org
parents:
diff changeset
    28
forge old style relation files
f60555898df4 new obsolete store
Pierre-Yves.David@ens-lyon.org
parents:
diff changeset
    29
f60555898df4 new obsolete store
Pierre-Yves.David@ens-lyon.org
parents:
diff changeset
    30
  $ hg log -r 2 --template='{node} ' > .hg/obsolete-relations
f60555898df4 new obsolete store
Pierre-Yves.David@ens-lyon.org
parents:
diff changeset
    31
  $ hg log -r 1 --template='{node}' >> .hg/obsolete-relations
f60555898df4 new obsolete store
Pierre-Yves.David@ens-lyon.org
parents:
diff changeset
    32
f60555898df4 new obsolete store
Pierre-Yves.David@ens-lyon.org
parents:
diff changeset
    33
enable the extensions
f60555898df4 new obsolete store
Pierre-Yves.David@ens-lyon.org
parents:
diff changeset
    34
f60555898df4 new obsolete store
Pierre-Yves.David@ens-lyon.org
parents:
diff changeset
    35
  $ echo "obsolete=$(echo $(dirname $TESTDIR))/hgext/obsolete.py" >> $HGRCPATH
f60555898df4 new obsolete store
Pierre-Yves.David@ens-lyon.org
parents:
diff changeset
    36
f60555898df4 new obsolete store
Pierre-Yves.David@ens-lyon.org
parents:
diff changeset
    37
  $ hg glog
f60555898df4 new obsolete store
Pierre-Yves.David@ens-lyon.org
parents:
diff changeset
    38
  abort: old format of obsolete marker detected!
f60555898df4 new obsolete store
Pierre-Yves.David@ens-lyon.org
parents:
diff changeset
    39
  run `hg debugconvertobsolete` once.
f60555898df4 new obsolete store
Pierre-Yves.David@ens-lyon.org
parents:
diff changeset
    40
  [255]
f60555898df4 new obsolete store
Pierre-Yves.David@ens-lyon.org
parents:
diff changeset
    41
  $ hg debugconvertobsolete --traceback
f60555898df4 new obsolete store
Pierre-Yves.David@ens-lyon.org
parents:
diff changeset
    42
  1 obsolete marker converted
f60555898df4 new obsolete store
Pierre-Yves.David@ens-lyon.org
parents:
diff changeset
    43
  $ hg glog
f60555898df4 new obsolete store
Pierre-Yves.David@ens-lyon.org
parents:
diff changeset
    44
  @  changeset:   2:d67cd0334eee
f60555898df4 new obsolete store
Pierre-Yves.David@ens-lyon.org
parents:
diff changeset
    45
  |  tag:         tip
f60555898df4 new obsolete store
Pierre-Yves.David@ens-lyon.org
parents:
diff changeset
    46
  |  parent:      0:1f0dee641bb7
f60555898df4 new obsolete store
Pierre-Yves.David@ens-lyon.org
parents:
diff changeset
    47
  |  user:        test
f60555898df4 new obsolete store
Pierre-Yves.David@ens-lyon.org
parents:
diff changeset
    48
  |  date:        Thu Jan 01 00:00:00 1970 +0000
f60555898df4 new obsolete store
Pierre-Yves.David@ens-lyon.org
parents:
diff changeset
    49
  |  summary:     add c
f60555898df4 new obsolete store
Pierre-Yves.David@ens-lyon.org
parents:
diff changeset
    50
  |
f60555898df4 new obsolete store
Pierre-Yves.David@ens-lyon.org
parents:
diff changeset
    51
  o  changeset:   0:1f0dee641bb7
f60555898df4 new obsolete store
Pierre-Yves.David@ens-lyon.org
parents:
diff changeset
    52
     user:        test
f60555898df4 new obsolete store
Pierre-Yves.David@ens-lyon.org
parents:
diff changeset
    53
     date:        Thu Jan 01 00:00:00 1970 +0000
f60555898df4 new obsolete store
Pierre-Yves.David@ens-lyon.org
parents:
diff changeset
    54
     summary:     add a
f60555898df4 new obsolete store
Pierre-Yves.David@ens-lyon.org
parents:
diff changeset
    55
  
f60555898df4 new obsolete store
Pierre-Yves.David@ens-lyon.org
parents:
diff changeset
    56
  $ hg debugconvertobsolete
f60555898df4 new obsolete store
Pierre-Yves.David@ens-lyon.org
parents:
diff changeset
    57
  nothing to do
f60555898df4 new obsolete store
Pierre-Yves.David@ens-lyon.org
parents:
diff changeset
    58
  0 obsolete marker converted