annotate tests/test-convert-git.t @ 20186:f5b461a4bc55

branchmap: introduce branchtip() method
author Brodie Rao <brodie@sf.io>
date Mon, 16 Sep 2013 01:08:29 -0700
parents aa9385f983fa
children 3420346174b1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5335
88e931f74e8b convert_git: avoid returning two entries for the same file in getchanges
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 5231
diff changeset
1
12530
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
2 $ "$TESTDIR/hghave" git || exit 80
16892
cfd892b7569f test-convert: disable autocrlf for git
Eduard-Cristian Stefan <alexandrul.ct@gmail.com>
parents: 15243
diff changeset
3 $ echo "[core]" >> $HOME/.gitconfig
cfd892b7569f test-convert: disable autocrlf for git
Eduard-Cristian Stefan <alexandrul.ct@gmail.com>
parents: 15243
diff changeset
4 $ echo "autocrlf = false" >> $HOME/.gitconfig
16954
8f36806b8f6a test-convert: disable autocrlf for git
Eduard-Cristian Stefan <alexandrul.ct@gmail.com>
parents: 16893
diff changeset
5 $ echo "[core]" >> $HOME/.gitconfig
8f36806b8f6a test-convert: disable autocrlf for git
Eduard-Cristian Stefan <alexandrul.ct@gmail.com>
parents: 16893
diff changeset
6 $ echo "autocrlf = false" >> $HOME/.gitconfig
12530
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
7 $ echo "[extensions]" >> $HGRCPATH
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
8 $ echo "convert=" >> $HGRCPATH
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
9 $ GIT_AUTHOR_NAME='test'; export GIT_AUTHOR_NAME
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
10 $ GIT_AUTHOR_EMAIL='test@example.org'; export GIT_AUTHOR_EMAIL
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
11 $ GIT_AUTHOR_DATE="2007-01-01 00:00:00 +0000"; export GIT_AUTHOR_DATE
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
12 $ GIT_COMMITTER_NAME="$GIT_AUTHOR_NAME"; export GIT_COMMITTER_NAME
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
13 $ GIT_COMMITTER_EMAIL="$GIT_AUTHOR_EMAIL"; export GIT_COMMITTER_EMAIL
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
14 $ GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"; export GIT_COMMITTER_DATE
19121
478a04605ce1 splicemap: improve error handling when source is git (issue2084)
Ben Goswami <bengoswami@fb.com>
parents: 18571
diff changeset
15 $ INVALIDID1=afd12345af
478a04605ce1 splicemap: improve error handling when source is git (issue2084)
Ben Goswami <bengoswami@fb.com>
parents: 18571
diff changeset
16 $ INVALIDID2=28173x36ddd1e67bf7098d541130558ef5534a86
478a04605ce1 splicemap: improve error handling when source is git (issue2084)
Ben Goswami <bengoswami@fb.com>
parents: 18571
diff changeset
17 $ VALIDID1=39b3d83f9a69a9ba4ebb111461071a0af0027357
478a04605ce1 splicemap: improve error handling when source is git (issue2084)
Ben Goswami <bengoswami@fb.com>
parents: 18571
diff changeset
18 $ VALIDID2=8dd6476bd09d9c7776355dc454dafe38efaec5da
12530
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
19 $ count=10
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
20 $ commit()
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
21 > {
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
22 > GIT_AUTHOR_DATE="2007-01-01 00:00:$count +0000"
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
23 > GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
24 > git commit "$@" >/dev/null 2>/dev/null || echo "git commit error"
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
25 > count=`expr $count + 1`
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
26 > }
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
27 $ mkdir git-repo
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
28 $ cd git-repo
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
29 $ git init-db >/dev/null 2>/dev/null
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
30 $ echo a > a
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
31 $ mkdir d
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
32 $ echo b > d/b
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
33 $ git add a d
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
34 $ commit -a -m t1
5335
88e931f74e8b convert_git: avoid returning two entries for the same file in getchanges
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 5231
diff changeset
35
12530
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
36 Remove the directory, then try to replace it with a file
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
37 (issue 754)
5335
88e931f74e8b convert_git: avoid returning two entries for the same file in getchanges
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 5231
diff changeset
38
12530
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
39 $ git rm -f d/b
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
40 rm 'd/b'
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
41 $ commit -m t2
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
42 $ echo d > d
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
43 $ git add d
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
44 $ commit -m t3
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
45 $ echo b >> a
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
46 $ commit -a -m t4.1
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
47 $ git checkout -b other HEAD~ >/dev/null 2>/dev/null
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
48 $ echo c > a
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
49 $ echo a >> a
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
50 $ commit -a -m t4.2
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
51 $ git checkout master >/dev/null 2>/dev/null
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
52 $ git pull --no-commit . other > /dev/null 2>/dev/null
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
53 $ commit -m 'Merge branch other'
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
54 $ cd ..
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
55 $ hg convert --datesort git-repo
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
56 assuming destination git-repo-hg
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
57 initializing destination git-repo-hg repository
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
58 scanning source...
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
59 sorting...
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
60 converting...
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
61 5 t1
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
62 4 t2
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
63 3 t3
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
64 2 t4.1
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
65 1 t4.2
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
66 0 Merge branch other
13756
6b7077df4aa5 convert: add bookmarks reading support to git backend
Edouard Gomez <ed.gomez@free.fr>
parents: 12743
diff changeset
67 updating bookmarks
12530
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
68 $ hg up -q -R git-repo-hg
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
69 $ hg -R git-repo-hg tip -v
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
70 changeset: 5:c78094926be2
13756
6b7077df4aa5 convert: add bookmarks reading support to git backend
Edouard Gomez <ed.gomez@free.fr>
parents: 12743
diff changeset
71 bookmark: master
12530
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
72 tag: tip
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
73 parent: 3:f5f5cb45432b
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
74 parent: 4:4e174f80c67c
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
75 user: test <test@example.org>
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
76 date: Mon Jan 01 00:00:15 2007 +0000
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
77 files: a
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
78 description:
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
79 Merge branch other
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
80
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
81
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
82 $ count=10
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
83 $ mkdir git-repo2
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
84 $ cd git-repo2
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
85 $ git init-db >/dev/null 2>/dev/null
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
86 $ echo foo > foo
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
87 $ git add foo
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
88 $ commit -a -m 'add foo'
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
89 $ echo >> foo
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
90 $ commit -a -m 'change foo'
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
91 $ git checkout -b Bar HEAD~ >/dev/null 2>/dev/null
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
92 $ echo quux >> quux
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
93 $ git add quux
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
94 $ commit -a -m 'add quux'
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
95 $ echo bar > bar
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
96 $ git add bar
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
97 $ commit -a -m 'add bar'
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
98 $ git checkout -b Baz HEAD~ >/dev/null 2>/dev/null
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
99 $ echo baz > baz
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
100 $ git add baz
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
101 $ commit -a -m 'add baz'
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
102 $ git checkout master >/dev/null 2>/dev/null
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
103 $ git pull --no-commit . Bar Baz > /dev/null 2>/dev/null
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
104 $ commit -m 'Octopus merge'
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
105 $ echo bar >> bar
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
106 $ commit -a -m 'change bar'
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
107 $ git checkout -b Foo HEAD~ >/dev/null 2>/dev/null
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
108 $ echo >> foo
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
109 $ commit -a -m 'change foo'
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
110 $ git checkout master >/dev/null 2>/dev/null
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
111 $ git pull --no-commit -s ours . Foo > /dev/null 2>/dev/null
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
112 $ commit -m 'Discard change to foo'
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
113 $ cd ..
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
114 $ glog()
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
115 > {
20117
aa9385f983fa tests: don't load unnecessary graphlog extension
Martin Geisler <martin@geisler.net>
parents: 19121
diff changeset
116 > hg log -G --template '{rev} "{desc|firstline}" files: {files}\n' "$@"
12530
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
117 > }
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
118 $ splitrepo()
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
119 > {
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
120 > msg="$1"
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
121 > files="$2"
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
122 > opts=$3
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
123 > echo "% $files: $msg"
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
124 > prefix=`echo "$files" | sed -e 's/ /-/g'`
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
125 > fmap="$prefix.fmap"
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
126 > repo="$prefix.repo"
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
127 > for i in $files; do
12743
4c4aeaab2339 check-code: add 'no tab indent' check for unified tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12530
diff changeset
128 > echo "include $i" >> "$fmap"
12530
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
129 > done
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
130 > hg -q convert $opts --filemap "$fmap" --datesort git-repo2 "$repo"
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
131 > hg up -q -R "$repo"
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
132 > glog -R "$repo"
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
133 > hg -R "$repo" manifest --debug
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
134 > }
5380
a5a7f7fd5554 convert_git: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 5369
diff changeset
135
12530
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
136 full conversion
5380
a5a7f7fd5554 convert_git: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 5369
diff changeset
137
12530
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
138 $ hg -q convert --datesort git-repo2 fullrepo
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
139 $ hg up -q -R fullrepo
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
140 $ glog -R fullrepo
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
141 @ 9 "Discard change to foo" files: foo
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
142 |\
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
143 | o 8 "change foo" files: foo
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
144 | |
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
145 o | 7 "change bar" files: bar
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
146 |/
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
147 o 6 "(octopus merge fixup)" files:
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
148 |\
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
149 | o 5 "Octopus merge" files: baz
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
150 | |\
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
151 o | | 4 "add baz" files: baz
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
152 | | |
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
153 +---o 3 "add bar" files: bar
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
154 | |
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
155 o | 2 "add quux" files: quux
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
156 | |
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
157 | o 1 "change foo" files: foo
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
158 |/
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
159 o 0 "add foo" files: foo
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
160
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
161 $ hg -R fullrepo manifest --debug
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
162 245a3b8bc653999c2b22cdabd517ccb47aecafdf 644 bar
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
163 354ae8da6e890359ef49ade27b68bbc361f3ca88 644 baz
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
164 9277c9cc8dd4576fc01a17939b4351e5ada93466 644 foo
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
165 88dfeab657e8cf2cef3dec67b914f49791ae76b1 644 quux
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
166 $ splitrepo 'octopus merge' 'foo bar baz'
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
167 % foo bar baz: octopus merge
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
168 @ 8 "Discard change to foo" files: foo
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
169 |\
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
170 | o 7 "change foo" files: foo
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
171 | |
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
172 o | 6 "change bar" files: bar
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
173 |/
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
174 o 5 "(octopus merge fixup)" files:
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
175 |\
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
176 | o 4 "Octopus merge" files: baz
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
177 | |\
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
178 o | | 3 "add baz" files: baz
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
179 | | |
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
180 +---o 2 "add bar" files: bar
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
181 | |
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
182 | o 1 "change foo" files: foo
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
183 |/
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
184 o 0 "add foo" files: foo
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
185
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
186 245a3b8bc653999c2b22cdabd517ccb47aecafdf 644 bar
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
187 354ae8da6e890359ef49ade27b68bbc361f3ca88 644 baz
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
188 9277c9cc8dd4576fc01a17939b4351e5ada93466 644 foo
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
189 $ splitrepo 'only some parents of an octopus merge; "discard" a head' 'foo baz quux'
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
190 % foo baz quux: only some parents of an octopus merge; "discard" a head
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
191 @ 6 "Discard change to foo" files: foo
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
192 |
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
193 o 5 "change foo" files: foo
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
194 |
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
195 o 4 "Octopus merge" files:
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
196 |\
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
197 | o 3 "add baz" files: baz
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
198 | |
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
199 | o 2 "add quux" files: quux
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
200 | |
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
201 o | 1 "change foo" files: foo
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
202 |/
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
203 o 0 "add foo" files: foo
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
204
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
205 354ae8da6e890359ef49ade27b68bbc361f3ca88 644 baz
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
206 9277c9cc8dd4576fc01a17939b4351e5ada93466 644 foo
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
207 88dfeab657e8cf2cef3dec67b914f49791ae76b1 644 quux
5380
a5a7f7fd5554 convert_git: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 5369
diff changeset
208
12530
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
209 test binary conversion (issue 1359)
5380
a5a7f7fd5554 convert_git: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 5369
diff changeset
210
12530
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
211 $ mkdir git-repo3
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
212 $ cd git-repo3
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
213 $ git init-db >/dev/null 2>/dev/null
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
214 $ python -c 'file("b", "wb").write("".join([chr(i) for i in range(256)])*16)'
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
215 $ git add b
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
216 $ commit -a -m addbinary
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
217 $ cd ..
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
218
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
219 convert binary file
7222
c1dc903dc7b6 convert: read git output in binary mode under Windows (issue 1359)
Patrick Mezard <pmezard@gmail.com>
parents: 5380
diff changeset
220
12530
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
221 $ hg convert git-repo3 git-repo3-hg
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
222 initializing destination git-repo3-hg repository
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
223 scanning source...
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
224 sorting...
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
225 converting...
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
226 0 addbinary
13756
6b7077df4aa5 convert: add bookmarks reading support to git backend
Edouard Gomez <ed.gomez@free.fr>
parents: 12743
diff changeset
227 updating bookmarks
12530
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
228 $ cd git-repo3-hg
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
229 $ hg up -C
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
230 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
231 $ python -c 'print len(file("b", "rb").read())'
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
232 4096
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
233 $ cd ..
7222
c1dc903dc7b6 convert: read git output in binary mode under Windows (issue 1359)
Patrick Mezard <pmezard@gmail.com>
parents: 5380
diff changeset
234
12530
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
235 test author vs committer
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
236
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
237 $ mkdir git-repo4
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
238 $ cd git-repo4
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
239 $ git init-db >/dev/null 2>/dev/null
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
240 $ echo >> foo
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
241 $ git add foo
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
242 $ commit -a -m addfoo
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
243 $ echo >> foo
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
244 $ GIT_AUTHOR_NAME="nottest"
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
245 $ commit -a -m addfoo2
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
246 $ cd ..
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
247
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
248 convert author committer
7222
c1dc903dc7b6 convert: read git output in binary mode under Windows (issue 1359)
Patrick Mezard <pmezard@gmail.com>
parents: 5380
diff changeset
249
12530
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
250 $ hg convert git-repo4 git-repo4-hg
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
251 initializing destination git-repo4-hg repository
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
252 scanning source...
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
253 sorting...
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
254 converting...
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
255 1 addfoo
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
256 0 addfoo2
13756
6b7077df4aa5 convert: add bookmarks reading support to git backend
Edouard Gomez <ed.gomez@free.fr>
parents: 12743
diff changeset
257 updating bookmarks
12530
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
258 $ hg -R git-repo4-hg log -v
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
259 changeset: 1:d63e967f93da
13756
6b7077df4aa5 convert: add bookmarks reading support to git backend
Edouard Gomez <ed.gomez@free.fr>
parents: 12743
diff changeset
260 bookmark: master
12530
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
261 tag: tip
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
262 user: nottest <test@example.org>
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
263 date: Mon Jan 01 00:00:21 2007 +0000
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
264 files: foo
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
265 description:
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
266 addfoo2
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
267
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
268 committer: test <test@example.org>
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
269
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
270
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
271 changeset: 0:0735477b0224
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
272 user: test <test@example.org>
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
273 date: Mon Jan 01 00:00:20 2007 +0000
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
274 files: foo
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
275 description:
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
276 addfoo
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
277
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
278
8691
a0a541d6fed6 convert: fail fast if source does not support --sourcesort
Patrick Mezard <pmezard@gmail.com>
parents: 8523
diff changeset
279
12530
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
280 --sourceorder should fail
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
281
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
282 $ hg convert --sourcesort git-repo4 git-repo4-sourcesort-hg
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
283 initializing destination git-repo4-sourcesort-hg repository
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
284 abort: --sourcesort is not supported by this data source
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
285 [255]
f11793a8c107 tests: unify test-convert-git
Matt Mackall <mpm@selenic.com>
parents: 10990
diff changeset
286
17929
0eed66327ad4 convert: add support for converting git submodule (issue3528)
YaNan Xu <robot9@fb.com>
parents: 16954
diff changeset
287 test sub modules
0eed66327ad4 convert: add support for converting git submodule (issue3528)
YaNan Xu <robot9@fb.com>
parents: 16954
diff changeset
288
0eed66327ad4 convert: add support for converting git submodule (issue3528)
YaNan Xu <robot9@fb.com>
parents: 16954
diff changeset
289 $ mkdir git-repo5
0eed66327ad4 convert: add support for converting git submodule (issue3528)
YaNan Xu <robot9@fb.com>
parents: 16954
diff changeset
290 $ cd git-repo5
0eed66327ad4 convert: add support for converting git submodule (issue3528)
YaNan Xu <robot9@fb.com>
parents: 16954
diff changeset
291 $ git init-db >/dev/null 2>/dev/null
0eed66327ad4 convert: add support for converting git submodule (issue3528)
YaNan Xu <robot9@fb.com>
parents: 16954
diff changeset
292 $ echo 'sub' >> foo
0eed66327ad4 convert: add support for converting git submodule (issue3528)
YaNan Xu <robot9@fb.com>
parents: 16954
diff changeset
293 $ git add foo
0eed66327ad4 convert: add support for converting git submodule (issue3528)
YaNan Xu <robot9@fb.com>
parents: 16954
diff changeset
294 $ commit -a -m 'addfoo'
18508
813b7a1f7036 tests: use `pwd` instead of ${PWD} in test-convert-git.t - because of Solaris
Mads Kiilerich <mads@kiilerich.com>
parents: 17929
diff changeset
295 $ BASE=`pwd`
17929
0eed66327ad4 convert: add support for converting git submodule (issue3528)
YaNan Xu <robot9@fb.com>
parents: 16954
diff changeset
296 $ cd ..
0eed66327ad4 convert: add support for converting git submodule (issue3528)
YaNan Xu <robot9@fb.com>
parents: 16954
diff changeset
297 $ mkdir git-repo6
0eed66327ad4 convert: add support for converting git submodule (issue3528)
YaNan Xu <robot9@fb.com>
parents: 16954
diff changeset
298 $ cd git-repo6
0eed66327ad4 convert: add support for converting git submodule (issue3528)
YaNan Xu <robot9@fb.com>
parents: 16954
diff changeset
299 $ git init-db >/dev/null 2>/dev/null
0eed66327ad4 convert: add support for converting git submodule (issue3528)
YaNan Xu <robot9@fb.com>
parents: 16954
diff changeset
300 $ git submodule add ${BASE} >/dev/null 2>/dev/null
0eed66327ad4 convert: add support for converting git submodule (issue3528)
YaNan Xu <robot9@fb.com>
parents: 16954
diff changeset
301 $ commit -a -m 'addsubmodule' >/dev/null 2>/dev/null
0eed66327ad4 convert: add support for converting git submodule (issue3528)
YaNan Xu <robot9@fb.com>
parents: 16954
diff changeset
302 $ cd ..
0eed66327ad4 convert: add support for converting git submodule (issue3528)
YaNan Xu <robot9@fb.com>
parents: 16954
diff changeset
303
19121
478a04605ce1 splicemap: improve error handling when source is git (issue2084)
Ben Goswami <bengoswami@fb.com>
parents: 18571
diff changeset
304 test invalid splicemap1
478a04605ce1 splicemap: improve error handling when source is git (issue2084)
Ben Goswami <bengoswami@fb.com>
parents: 18571
diff changeset
305
478a04605ce1 splicemap: improve error handling when source is git (issue2084)
Ben Goswami <bengoswami@fb.com>
parents: 18571
diff changeset
306 $ cat > splicemap <<EOF
478a04605ce1 splicemap: improve error handling when source is git (issue2084)
Ben Goswami <bengoswami@fb.com>
parents: 18571
diff changeset
307 > $VALIDID1
478a04605ce1 splicemap: improve error handling when source is git (issue2084)
Ben Goswami <bengoswami@fb.com>
parents: 18571
diff changeset
308 > EOF
478a04605ce1 splicemap: improve error handling when source is git (issue2084)
Ben Goswami <bengoswami@fb.com>
parents: 18571
diff changeset
309 $ hg convert --splicemap splicemap git-repo2 git-repo2-splicemap1-hg
478a04605ce1 splicemap: improve error handling when source is git (issue2084)
Ben Goswami <bengoswami@fb.com>
parents: 18571
diff changeset
310 initializing destination git-repo2-splicemap1-hg repository
478a04605ce1 splicemap: improve error handling when source is git (issue2084)
Ben Goswami <bengoswami@fb.com>
parents: 18571
diff changeset
311 abort: syntax error in splicemap(1): child parent1[,parent2] expected
478a04605ce1 splicemap: improve error handling when source is git (issue2084)
Ben Goswami <bengoswami@fb.com>
parents: 18571
diff changeset
312 [255]
478a04605ce1 splicemap: improve error handling when source is git (issue2084)
Ben Goswami <bengoswami@fb.com>
parents: 18571
diff changeset
313
478a04605ce1 splicemap: improve error handling when source is git (issue2084)
Ben Goswami <bengoswami@fb.com>
parents: 18571
diff changeset
314 test invalid splicemap2
478a04605ce1 splicemap: improve error handling when source is git (issue2084)
Ben Goswami <bengoswami@fb.com>
parents: 18571
diff changeset
315
478a04605ce1 splicemap: improve error handling when source is git (issue2084)
Ben Goswami <bengoswami@fb.com>
parents: 18571
diff changeset
316 $ cat > splicemap <<EOF
478a04605ce1 splicemap: improve error handling when source is git (issue2084)
Ben Goswami <bengoswami@fb.com>
parents: 18571
diff changeset
317 > $VALIDID1 $VALIDID2, $VALIDID2, $VALIDID2
478a04605ce1 splicemap: improve error handling when source is git (issue2084)
Ben Goswami <bengoswami@fb.com>
parents: 18571
diff changeset
318 > EOF
478a04605ce1 splicemap: improve error handling when source is git (issue2084)
Ben Goswami <bengoswami@fb.com>
parents: 18571
diff changeset
319 $ hg convert --splicemap splicemap git-repo2 git-repo2-splicemap2-hg
478a04605ce1 splicemap: improve error handling when source is git (issue2084)
Ben Goswami <bengoswami@fb.com>
parents: 18571
diff changeset
320 initializing destination git-repo2-splicemap2-hg repository
478a04605ce1 splicemap: improve error handling when source is git (issue2084)
Ben Goswami <bengoswami@fb.com>
parents: 18571
diff changeset
321 abort: syntax error in splicemap(1): child parent1[,parent2] expected
478a04605ce1 splicemap: improve error handling when source is git (issue2084)
Ben Goswami <bengoswami@fb.com>
parents: 18571
diff changeset
322 [255]
478a04605ce1 splicemap: improve error handling when source is git (issue2084)
Ben Goswami <bengoswami@fb.com>
parents: 18571
diff changeset
323
478a04605ce1 splicemap: improve error handling when source is git (issue2084)
Ben Goswami <bengoswami@fb.com>
parents: 18571
diff changeset
324 test invalid splicemap3
478a04605ce1 splicemap: improve error handling when source is git (issue2084)
Ben Goswami <bengoswami@fb.com>
parents: 18571
diff changeset
325
478a04605ce1 splicemap: improve error handling when source is git (issue2084)
Ben Goswami <bengoswami@fb.com>
parents: 18571
diff changeset
326 $ cat > splicemap <<EOF
478a04605ce1 splicemap: improve error handling when source is git (issue2084)
Ben Goswami <bengoswami@fb.com>
parents: 18571
diff changeset
327 > $INVALIDID1 $INVALIDID2
478a04605ce1 splicemap: improve error handling when source is git (issue2084)
Ben Goswami <bengoswami@fb.com>
parents: 18571
diff changeset
328 > EOF
478a04605ce1 splicemap: improve error handling when source is git (issue2084)
Ben Goswami <bengoswami@fb.com>
parents: 18571
diff changeset
329 $ hg convert --splicemap splicemap git-repo2 git-repo2-splicemap3-hg
478a04605ce1 splicemap: improve error handling when source is git (issue2084)
Ben Goswami <bengoswami@fb.com>
parents: 18571
diff changeset
330 initializing destination git-repo2-splicemap3-hg repository
478a04605ce1 splicemap: improve error handling when source is git (issue2084)
Ben Goswami <bengoswami@fb.com>
parents: 18571
diff changeset
331 abort: splicemap entry afd12345af is not a valid revision identifier
478a04605ce1 splicemap: improve error handling when source is git (issue2084)
Ben Goswami <bengoswami@fb.com>
parents: 18571
diff changeset
332 [255]
478a04605ce1 splicemap: improve error handling when source is git (issue2084)
Ben Goswami <bengoswami@fb.com>
parents: 18571
diff changeset
333
17929
0eed66327ad4 convert: add support for converting git submodule (issue3528)
YaNan Xu <robot9@fb.com>
parents: 16954
diff changeset
334 convert sub modules
0eed66327ad4 convert: add support for converting git submodule (issue3528)
YaNan Xu <robot9@fb.com>
parents: 16954
diff changeset
335 $ hg convert git-repo6 git-repo6-hg
0eed66327ad4 convert: add support for converting git submodule (issue3528)
YaNan Xu <robot9@fb.com>
parents: 16954
diff changeset
336 initializing destination git-repo6-hg repository
0eed66327ad4 convert: add support for converting git submodule (issue3528)
YaNan Xu <robot9@fb.com>
parents: 16954
diff changeset
337 scanning source...
0eed66327ad4 convert: add support for converting git submodule (issue3528)
YaNan Xu <robot9@fb.com>
parents: 16954
diff changeset
338 sorting...
0eed66327ad4 convert: add support for converting git submodule (issue3528)
YaNan Xu <robot9@fb.com>
parents: 16954
diff changeset
339 converting...
0eed66327ad4 convert: add support for converting git submodule (issue3528)
YaNan Xu <robot9@fb.com>
parents: 16954
diff changeset
340 0 addsubmodule
0eed66327ad4 convert: add support for converting git submodule (issue3528)
YaNan Xu <robot9@fb.com>
parents: 16954
diff changeset
341 updating bookmarks
0eed66327ad4 convert: add support for converting git submodule (issue3528)
YaNan Xu <robot9@fb.com>
parents: 16954
diff changeset
342 $ hg -R git-repo6-hg log -v
0eed66327ad4 convert: add support for converting git submodule (issue3528)
YaNan Xu <robot9@fb.com>
parents: 16954
diff changeset
343 changeset: 0:* (glob)
0eed66327ad4 convert: add support for converting git submodule (issue3528)
YaNan Xu <robot9@fb.com>
parents: 16954
diff changeset
344 bookmark: master
0eed66327ad4 convert: add support for converting git submodule (issue3528)
YaNan Xu <robot9@fb.com>
parents: 16954
diff changeset
345 tag: tip
0eed66327ad4 convert: add support for converting git submodule (issue3528)
YaNan Xu <robot9@fb.com>
parents: 16954
diff changeset
346 user: nottest <test@example.org>
0eed66327ad4 convert: add support for converting git submodule (issue3528)
YaNan Xu <robot9@fb.com>
parents: 16954
diff changeset
347 date: Mon Jan 01 00:00:23 2007 +0000
0eed66327ad4 convert: add support for converting git submodule (issue3528)
YaNan Xu <robot9@fb.com>
parents: 16954
diff changeset
348 files: .hgsub .hgsubstate
0eed66327ad4 convert: add support for converting git submodule (issue3528)
YaNan Xu <robot9@fb.com>
parents: 16954
diff changeset
349 description:
0eed66327ad4 convert: add support for converting git submodule (issue3528)
YaNan Xu <robot9@fb.com>
parents: 16954
diff changeset
350 addsubmodule
0eed66327ad4 convert: add support for converting git submodule (issue3528)
YaNan Xu <robot9@fb.com>
parents: 16954
diff changeset
351
0eed66327ad4 convert: add support for converting git submodule (issue3528)
YaNan Xu <robot9@fb.com>
parents: 16954
diff changeset
352 committer: test <test@example.org>
0eed66327ad4 convert: add support for converting git submodule (issue3528)
YaNan Xu <robot9@fb.com>
parents: 16954
diff changeset
353
0eed66327ad4 convert: add support for converting git submodule (issue3528)
YaNan Xu <robot9@fb.com>
parents: 16954
diff changeset
354
0eed66327ad4 convert: add support for converting git submodule (issue3528)
YaNan Xu <robot9@fb.com>
parents: 16954
diff changeset
355
0eed66327ad4 convert: add support for converting git submodule (issue3528)
YaNan Xu <robot9@fb.com>
parents: 16954
diff changeset
356 $ cd git-repo6-hg
0eed66327ad4 convert: add support for converting git submodule (issue3528)
YaNan Xu <robot9@fb.com>
parents: 16954
diff changeset
357 $ hg up >/dev/null 2>/dev/null
0eed66327ad4 convert: add support for converting git submodule (issue3528)
YaNan Xu <robot9@fb.com>
parents: 16954
diff changeset
358 $ cat .hgsubstate
0eed66327ad4 convert: add support for converting git submodule (issue3528)
YaNan Xu <robot9@fb.com>
parents: 16954
diff changeset
359 * git-repo5 (glob)
0eed66327ad4 convert: add support for converting git submodule (issue3528)
YaNan Xu <robot9@fb.com>
parents: 16954
diff changeset
360 $ cd git-repo5
0eed66327ad4 convert: add support for converting git submodule (issue3528)
YaNan Xu <robot9@fb.com>
parents: 16954
diff changeset
361 $ cat foo
0eed66327ad4 convert: add support for converting git submodule (issue3528)
YaNan Xu <robot9@fb.com>
parents: 16954
diff changeset
362 sub
18571
ad5817505834 test-convert-git: stabilize corruption of test git repo
Ross Lagerwall <rosslagerwall@gmail.com>
parents: 18508
diff changeset
363
ad5817505834 test-convert-git: stabilize corruption of test git repo
Ross Lagerwall <rosslagerwall@gmail.com>
parents: 18508
diff changeset
364 $ cd ../..
ad5817505834 test-convert-git: stabilize corruption of test git repo
Ross Lagerwall <rosslagerwall@gmail.com>
parents: 18508
diff changeset
365
ad5817505834 test-convert-git: stabilize corruption of test git repo
Ross Lagerwall <rosslagerwall@gmail.com>
parents: 18508
diff changeset
366 damaged git repository tests:
ad5817505834 test-convert-git: stabilize corruption of test git repo
Ross Lagerwall <rosslagerwall@gmail.com>
parents: 18508
diff changeset
367 In case the hard-coded hashes change, the following commands can be used to
ad5817505834 test-convert-git: stabilize corruption of test git repo
Ross Lagerwall <rosslagerwall@gmail.com>
parents: 18508
diff changeset
368 list the hashes and their corresponding types in the repository:
ad5817505834 test-convert-git: stabilize corruption of test git repo
Ross Lagerwall <rosslagerwall@gmail.com>
parents: 18508
diff changeset
369 cd git-repo4/.git/objects
ad5817505834 test-convert-git: stabilize corruption of test git repo
Ross Lagerwall <rosslagerwall@gmail.com>
parents: 18508
diff changeset
370 find . -type f | cut -c 3- | sed 's_/__' | xargs -n 1 -t git cat-file -t
ad5817505834 test-convert-git: stabilize corruption of test git repo
Ross Lagerwall <rosslagerwall@gmail.com>
parents: 18508
diff changeset
371 cd ../../..
ad5817505834 test-convert-git: stabilize corruption of test git repo
Ross Lagerwall <rosslagerwall@gmail.com>
parents: 18508
diff changeset
372
ad5817505834 test-convert-git: stabilize corruption of test git repo
Ross Lagerwall <rosslagerwall@gmail.com>
parents: 18508
diff changeset
373 damage git repository by renaming a commit object
ad5817505834 test-convert-git: stabilize corruption of test git repo
Ross Lagerwall <rosslagerwall@gmail.com>
parents: 18508
diff changeset
374 $ COMMIT_OBJ=1c/0ce3c5886f83a1d78a7b517cdff5cf9ca17bdd
ad5817505834 test-convert-git: stabilize corruption of test git repo
Ross Lagerwall <rosslagerwall@gmail.com>
parents: 18508
diff changeset
375 $ mv git-repo4/.git/objects/$COMMIT_OBJ git-repo4/.git/objects/$COMMIT_OBJ.tmp
ad5817505834 test-convert-git: stabilize corruption of test git repo
Ross Lagerwall <rosslagerwall@gmail.com>
parents: 18508
diff changeset
376 $ hg convert git-repo4 git-repo4-broken-hg 2>&1 | grep 'abort:'
ad5817505834 test-convert-git: stabilize corruption of test git repo
Ross Lagerwall <rosslagerwall@gmail.com>
parents: 18508
diff changeset
377 abort: cannot read tags from git-repo4/.git
ad5817505834 test-convert-git: stabilize corruption of test git repo
Ross Lagerwall <rosslagerwall@gmail.com>
parents: 18508
diff changeset
378 $ mv git-repo4/.git/objects/$COMMIT_OBJ.tmp git-repo4/.git/objects/$COMMIT_OBJ
ad5817505834 test-convert-git: stabilize corruption of test git repo
Ross Lagerwall <rosslagerwall@gmail.com>
parents: 18508
diff changeset
379 damage git repository by renaming a blob object
ad5817505834 test-convert-git: stabilize corruption of test git repo
Ross Lagerwall <rosslagerwall@gmail.com>
parents: 18508
diff changeset
380
ad5817505834 test-convert-git: stabilize corruption of test git repo
Ross Lagerwall <rosslagerwall@gmail.com>
parents: 18508
diff changeset
381 $ BLOB_OBJ=8b/137891791fe96927ad78e64b0aad7bded08bdc
ad5817505834 test-convert-git: stabilize corruption of test git repo
Ross Lagerwall <rosslagerwall@gmail.com>
parents: 18508
diff changeset
382 $ mv git-repo4/.git/objects/$BLOB_OBJ git-repo4/.git/objects/$BLOB_OBJ.tmp
ad5817505834 test-convert-git: stabilize corruption of test git repo
Ross Lagerwall <rosslagerwall@gmail.com>
parents: 18508
diff changeset
383 $ hg convert git-repo4 git-repo4-broken-hg 2>&1 | grep 'abort:'
ad5817505834 test-convert-git: stabilize corruption of test git repo
Ross Lagerwall <rosslagerwall@gmail.com>
parents: 18508
diff changeset
384 abort: cannot read 'blob' object at 8b137891791fe96927ad78e64b0aad7bded08bdc
ad5817505834 test-convert-git: stabilize corruption of test git repo
Ross Lagerwall <rosslagerwall@gmail.com>
parents: 18508
diff changeset
385 $ mv git-repo4/.git/objects/$BLOB_OBJ.tmp git-repo4/.git/objects/$BLOB_OBJ
ad5817505834 test-convert-git: stabilize corruption of test git repo
Ross Lagerwall <rosslagerwall@gmail.com>
parents: 18508
diff changeset
386 damage git repository by renaming a tree object
ad5817505834 test-convert-git: stabilize corruption of test git repo
Ross Lagerwall <rosslagerwall@gmail.com>
parents: 18508
diff changeset
387
ad5817505834 test-convert-git: stabilize corruption of test git repo
Ross Lagerwall <rosslagerwall@gmail.com>
parents: 18508
diff changeset
388 $ TREE_OBJ=72/49f083d2a63a41cc737764a86981eb5f3e4635
ad5817505834 test-convert-git: stabilize corruption of test git repo
Ross Lagerwall <rosslagerwall@gmail.com>
parents: 18508
diff changeset
389 $ mv git-repo4/.git/objects/$TREE_OBJ git-repo4/.git/objects/$TREE_OBJ.tmp
ad5817505834 test-convert-git: stabilize corruption of test git repo
Ross Lagerwall <rosslagerwall@gmail.com>
parents: 18508
diff changeset
390 $ hg convert git-repo4 git-repo4-broken-hg 2>&1 | grep 'abort:'
ad5817505834 test-convert-git: stabilize corruption of test git repo
Ross Lagerwall <rosslagerwall@gmail.com>
parents: 18508
diff changeset
391 abort: cannot read changes in 1c0ce3c5886f83a1d78a7b517cdff5cf9ca17bdd