tests/test-convert-hg-source.t
author Martin Geisler <mg@aragost.com>
Fri, 09 Dec 2011 17:34:56 +0100
changeset 15627 9d7a83a42f8c
parent 15442 db0340f4b507
child 16708 4a02cf4fbb2e
permissions -rw-r--r--
largefiles: fix indentation
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
15442
db0340f4b507 tests: use 'hghave execbit' for tests that manipulate x bit in file system
Mads Kiilerich <mads@kiilerich.com>
parents: 13969
diff changeset
     1
  $ "$TESTDIR/hghave" execbit || exit 80
5280
11e1e574da02 convert: mercurial_source: also search for copies in modified files
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
     2
12526
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
     3
  $ cat >> $HGRCPATH <<EOF
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
     4
  > [extensions]
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
     5
  > convert=
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
     6
  > [convert]
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
     7
  > hg.saverev=False
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
     8
  > EOF
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
     9
  $ hg init orig
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
    10
  $ cd orig
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
    11
  $ echo foo > foo
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
    12
  $ echo bar > bar
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
    13
  $ hg ci -qAm 'add foo bar' -d '0 0'
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
    14
  $ echo >> foo
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
    15
  $ hg ci -m 'change foo' -d '1 0'
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
    16
  $ hg up -qC 0
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
    17
  $ hg copy --after --force foo bar
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
    18
  $ hg copy foo baz
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
    19
  $ hg ci -m 'make bar and baz copies of foo' -d '2 0'
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
    20
  created new head
13866
2f93a4a10144 convert: add hg source bookmark test
Edouard Gomez <ed.gomez@free.fr>
parents: 12526
diff changeset
    21
  $ hg bookmark premerge1
12526
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
    22
  $ hg merge
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
    23
  merging baz and foo to baz
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
    24
  1 files updated, 1 files merged, 0 files removed, 0 files unresolved
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
    25
  (branch merge, don't forget to commit)
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
    26
  $ hg ci -m 'merge local copy' -d '3 0'
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
    27
  $ hg up -C 1
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
    28
  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
13866
2f93a4a10144 convert: add hg source bookmark test
Edouard Gomez <ed.gomez@free.fr>
parents: 12526
diff changeset
    29
  $ hg bookmark premerge2
12526
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
    30
  $ hg merge 2
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
    31
  merging foo and baz to baz
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
    32
  1 files updated, 1 files merged, 0 files removed, 0 files unresolved
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
    33
  (branch merge, don't forget to commit)
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
    34
  $ hg ci -m 'merge remote copy' -d '4 0'
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
    35
  created new head
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
    36
  $ chmod +x baz
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
    37
  $ hg ci -m 'mark baz executable' -d '5 0'
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
    38
  $ cd ..
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
    39
  $ hg convert --datesort orig new 2>&1 | grep -v 'subversion python bindings could not be loaded'
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
    40
  initializing destination new repository
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
    41
  scanning source...
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
    42
  sorting...
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
    43
  converting...
13968
82845434e974 convert: make filemap prune useless branch closing revs (issue2774)
Patrick Mezard <pmezard@gmail.com>
parents: 12526
diff changeset
    44
  5 add foo bar
82845434e974 convert: make filemap prune useless branch closing revs (issue2774)
Patrick Mezard <pmezard@gmail.com>
parents: 12526
diff changeset
    45
  4 change foo
82845434e974 convert: make filemap prune useless branch closing revs (issue2774)
Patrick Mezard <pmezard@gmail.com>
parents: 12526
diff changeset
    46
  3 make bar and baz copies of foo
82845434e974 convert: make filemap prune useless branch closing revs (issue2774)
Patrick Mezard <pmezard@gmail.com>
parents: 12526
diff changeset
    47
  2 merge local copy
82845434e974 convert: make filemap prune useless branch closing revs (issue2774)
Patrick Mezard <pmezard@gmail.com>
parents: 12526
diff changeset
    48
  1 merge remote copy
82845434e974 convert: make filemap prune useless branch closing revs (issue2774)
Patrick Mezard <pmezard@gmail.com>
parents: 12526
diff changeset
    49
  0 mark baz executable
13866
2f93a4a10144 convert: add hg source bookmark test
Edouard Gomez <ed.gomez@free.fr>
parents: 12526
diff changeset
    50
  updating bookmarks
12526
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
    51
  $ cd new
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
    52
  $ hg out ../orig
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
    53
  comparing with ../orig
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
    54
  searching for changes
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
    55
  no changes found
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
    56
  [1]
13866
2f93a4a10144 convert: add hg source bookmark test
Edouard Gomez <ed.gomez@free.fr>
parents: 12526
diff changeset
    57
  $ hg bookmarks
2f93a4a10144 convert: add hg source bookmark test
Edouard Gomez <ed.gomez@free.fr>
parents: 12526
diff changeset
    58
     premerge1                 3:973ef48a98a4
13969
336bb8b53ad0 merge with stable
Patrick Mezard <pmezard@gmail.com>
parents: 13866 13968
diff changeset
    59
     premerge2                 5:13d9b87cf8f8
12526
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
    60
  $ cd ..
5280
11e1e574da02 convert: mercurial_source: also search for copies in modified files
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    61
12526
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
    62
check shamap LF and CRLF handling
7231
8e7130a10f3b convert: ignore hg source errors with hg.ignoreerrors (issue 1357)
Patrick Mezard <pmezard@gmail.com>
parents: 5811
diff changeset
    63
12526
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
    64
  $ cat > rewrite.py <<EOF
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
    65
  > import sys
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
    66
  > # Interlace LF and CRLF
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
    67
  > lines = [(l.rstrip() + ((i % 2) and '\n' or '\r\n'))
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
    68
  >          for i, l in enumerate(file(sys.argv[1]))]
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
    69
  > file(sys.argv[1], 'wb').write(''.join(lines))
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
    70
  > EOF
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
    71
  $ python rewrite.py new/.hg/shamap
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
    72
  $ cd orig
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
    73
  $ hg up -qC 1
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
    74
  $ echo foo >> foo
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
    75
  $ hg ci -qm 'change foo again'
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
    76
  $ hg up -qC 2
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
    77
  $ echo foo >> foo
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
    78
  $ hg ci -qm 'change foo again again'
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
    79
  $ cd ..
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
    80
  $ hg convert --datesort orig new 2>&1 | grep -v 'subversion python bindings could not be loaded'
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
    81
  scanning source...
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
    82
  sorting...
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
    83
  converting...
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
    84
  1 change foo again again
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
    85
  0 change foo again
13866
2f93a4a10144 convert: add hg source bookmark test
Edouard Gomez <ed.gomez@free.fr>
parents: 12526
diff changeset
    86
  updating bookmarks
12526
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
    87
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
    88
init broken repository
9528
314fc589b313 convert: make mapfile handle LF and CRLF shamap (issue1846)
Patrick Mezard <pmezard@gmail.com>
parents: 7231
diff changeset
    89
12526
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
    90
  $ hg init broken
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
    91
  $ cd broken
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
    92
  $ echo a >> a
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
    93
  $ echo b >> b
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
    94
  $ hg ci -qAm init
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
    95
  $ echo a >> a
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
    96
  $ echo b >> b
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
    97
  $ hg copy b c
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
    98
  $ hg ci -qAm changeall
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
    99
  $ hg up -qC 0
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
   100
  $ echo bc >> b
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
   101
  $ hg ci -m changebagain
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
   102
  created new head
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
   103
  $ HGMERGE=internal:local hg -q merge
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
   104
  $ hg ci -m merge
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
   105
  $ hg mv b d
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
   106
  $ hg ci -m moveb
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
   107
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
   108
break it
7231
8e7130a10f3b convert: ignore hg source errors with hg.ignoreerrors (issue 1357)
Patrick Mezard <pmezard@gmail.com>
parents: 5811
diff changeset
   109
12526
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
   110
  $ rm .hg/store/data/b.*
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
   111
  $ cd ..
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
   112
  $ hg --config convert.hg.ignoreerrors=True convert broken fixed
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
   113
  initializing destination fixed repository
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
   114
  scanning source...
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
   115
  sorting...
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
   116
  converting...
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
   117
  4 init
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
   118
  ignoring: data/b.i@1e88685f5dde: no match found
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
   119
  3 changeall
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
   120
  2 changebagain
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
   121
  1 merge
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
   122
  0 moveb
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
   123
  $ hg -R fixed verify
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
   124
  checking changesets
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
   125
  checking manifests
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
   126
  crosschecking files in changesets and manifests
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
   127
  checking files
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
   128
  3 files, 5 changesets, 5 total revisions
5280
11e1e574da02 convert: mercurial_source: also search for copies in modified files
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
   129
12526
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
   130
manifest -r 0
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
   131
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
   132
  $ hg -R fixed manifest -r 0
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
   133
  a
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
   134
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
   135
manifest -r tip
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
   136
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
   137
  $ hg -R fixed manifest -r tip
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
   138
  a
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
   139
  c
9892949bd969 tests: unify test-convert-hg-source
Matt Mackall <mpm@selenic.com>
parents: 11673
diff changeset
   140
  d