##// END OF EJS Templates
convert/git: check status when reading output stream
Patrick Mezard -
r10987:b3af02b1 stable
parent child Browse files
Show More
@@ -1,166 +1,170 b''
1 # git.py - git support for the convert extension
1 # git.py - git support for the convert extension
2 #
2 #
3 # Copyright 2005-2009 Matt Mackall <mpm@selenic.com> and others
3 # Copyright 2005-2009 Matt Mackall <mpm@selenic.com> and others
4 #
4 #
5 # This software may be used and distributed according to the terms of the
5 # This software may be used and distributed according to the terms of the
6 # GNU General Public License version 2 or any later version.
6 # GNU General Public License version 2 or any later version.
7
7
8 import os
8 import os
9 from mercurial import util
9 from mercurial import util
10 from mercurial.i18n import _
10 from mercurial.i18n import _
11
11
12 from common import NoRepo, commit, converter_source, checktool
12 from common import NoRepo, commit, converter_source, checktool
13
13
14 class convert_git(converter_source):
14 class convert_git(converter_source):
15 # Windows does not support GIT_DIR= construct while other systems
15 # Windows does not support GIT_DIR= construct while other systems
16 # cannot remove environment variable. Just assume none have
16 # cannot remove environment variable. Just assume none have
17 # both issues.
17 # both issues.
18 if hasattr(os, 'unsetenv'):
18 if hasattr(os, 'unsetenv'):
19 def gitopen(self, s):
19 def gitopen(self, s):
20 prevgitdir = os.environ.get('GIT_DIR')
20 prevgitdir = os.environ.get('GIT_DIR')
21 os.environ['GIT_DIR'] = self.path
21 os.environ['GIT_DIR'] = self.path
22 try:
22 try:
23 return util.popen(s, 'rb')
23 return util.popen(s, 'rb')
24 finally:
24 finally:
25 if prevgitdir is None:
25 if prevgitdir is None:
26 del os.environ['GIT_DIR']
26 del os.environ['GIT_DIR']
27 else:
27 else:
28 os.environ['GIT_DIR'] = prevgitdir
28 os.environ['GIT_DIR'] = prevgitdir
29 else:
29 else:
30 def gitopen(self, s):
30 def gitopen(self, s):
31 return util.popen('GIT_DIR=%s %s' % (self.path, s), 'rb')
31 return util.popen('GIT_DIR=%s %s' % (self.path, s), 'rb')
32
32
33 def gitread(self, s):
33 def gitread(self, s):
34 fh = self.gitopen(s)
34 fh = self.gitopen(s)
35 data = fh.read()
35 data = fh.read()
36 return data, fh.close()
36 return data, fh.close()
37
37
38 def __init__(self, ui, path, rev=None):
38 def __init__(self, ui, path, rev=None):
39 super(convert_git, self).__init__(ui, path, rev=rev)
39 super(convert_git, self).__init__(ui, path, rev=rev)
40
40
41 if os.path.isdir(path + "/.git"):
41 if os.path.isdir(path + "/.git"):
42 path += "/.git"
42 path += "/.git"
43 if not os.path.exists(path + "/objects"):
43 if not os.path.exists(path + "/objects"):
44 raise NoRepo(_("%s does not look like a Git repository") % path)
44 raise NoRepo(_("%s does not look like a Git repository") % path)
45
45
46 checktool('git', 'git')
46 checktool('git', 'git')
47
47
48 self.path = path
48 self.path = path
49
49
50 def getheads(self):
50 def getheads(self):
51 if not self.rev:
51 if not self.rev:
52 heads, ret = self.gitread('git rev-parse --branches --remotes')
52 heads, ret = self.gitread('git rev-parse --branches --remotes')
53 heads = heads.splitlines()
53 heads = heads.splitlines()
54 else:
54 else:
55 heads, ret = self.gitread("git rev-parse --verify %s" % self.rev)
55 heads, ret = self.gitread("git rev-parse --verify %s" % self.rev)
56 heads = [heads[:-1]]
56 heads = [heads[:-1]]
57 if ret:
57 if ret:
58 raise util.Abort(_('cannot retrieve git heads'))
58 raise util.Abort(_('cannot retrieve git heads'))
59 return heads
59 return heads
60
60
61 def catfile(self, rev, type):
61 def catfile(self, rev, type):
62 if rev == "0" * 40:
62 if rev == "0" * 40:
63 raise IOError()
63 raise IOError()
64 data, ret = self.gitread("git cat-file %s %s" % (type, rev))
64 data, ret = self.gitread("git cat-file %s %s" % (type, rev))
65 if ret:
65 if ret:
66 raise util.Abort(_('cannot read %r object at %s') % (type, rev))
66 raise util.Abort(_('cannot read %r object at %s') % (type, rev))
67 return data
67 return data
68
68
69 def getfile(self, name, rev):
69 def getfile(self, name, rev):
70 return self.catfile(rev, "blob")
70 return self.catfile(rev, "blob")
71
71
72 def getmode(self, name, rev):
72 def getmode(self, name, rev):
73 return self.modecache[(name, rev)]
73 return self.modecache[(name, rev)]
74
74
75 def getchanges(self, version):
75 def getchanges(self, version):
76 self.modecache = {}
76 self.modecache = {}
77 fh = self.gitopen("git diff-tree -z --root -m -r %s" % version)
77 fh = self.gitopen("git diff-tree -z --root -m -r %s" % version)
78 changes = []
78 changes = []
79 seen = set()
79 seen = set()
80 entry = None
80 entry = None
81 for l in fh.read().split('\x00'):
81 for l in fh.read().split('\x00'):
82 if not entry:
82 if not entry:
83 if not l.startswith(':'):
83 if not l.startswith(':'):
84 continue
84 continue
85 entry = l
85 entry = l
86 continue
86 continue
87 f = l
87 f = l
88 if f not in seen:
88 if f not in seen:
89 seen.add(f)
89 seen.add(f)
90 entry = entry.split()
90 entry = entry.split()
91 h = entry[3]
91 h = entry[3]
92 p = (entry[1] == "100755")
92 p = (entry[1] == "100755")
93 s = (entry[1] == "120000")
93 s = (entry[1] == "120000")
94 self.modecache[(f, h)] = (p and "x") or (s and "l") or ""
94 self.modecache[(f, h)] = (p and "x") or (s and "l") or ""
95 changes.append((f, h))
95 changes.append((f, h))
96 entry = None
96 entry = None
97 if fh.close():
98 raise util.Abort(_('cannot read changes in %s') % version)
97 return (changes, {})
99 return (changes, {})
98
100
99 def getcommit(self, version):
101 def getcommit(self, version):
100 c = self.catfile(version, "commit") # read the commit hash
102 c = self.catfile(version, "commit") # read the commit hash
101 end = c.find("\n\n")
103 end = c.find("\n\n")
102 message = c[end + 2:]
104 message = c[end + 2:]
103 message = self.recode(message)
105 message = self.recode(message)
104 l = c[:end].splitlines()
106 l = c[:end].splitlines()
105 parents = []
107 parents = []
106 author = committer = None
108 author = committer = None
107 for e in l[1:]:
109 for e in l[1:]:
108 n, v = e.split(" ", 1)
110 n, v = e.split(" ", 1)
109 if n == "author":
111 if n == "author":
110 p = v.split()
112 p = v.split()
111 tm, tz = p[-2:]
113 tm, tz = p[-2:]
112 author = " ".join(p[:-2])
114 author = " ".join(p[:-2])
113 if author[0] == "<": author = author[1:-1]
115 if author[0] == "<": author = author[1:-1]
114 author = self.recode(author)
116 author = self.recode(author)
115 if n == "committer":
117 if n == "committer":
116 p = v.split()
118 p = v.split()
117 tm, tz = p[-2:]
119 tm, tz = p[-2:]
118 committer = " ".join(p[:-2])
120 committer = " ".join(p[:-2])
119 if committer[0] == "<": committer = committer[1:-1]
121 if committer[0] == "<": committer = committer[1:-1]
120 committer = self.recode(committer)
122 committer = self.recode(committer)
121 if n == "parent":
123 if n == "parent":
122 parents.append(v)
124 parents.append(v)
123
125
124 if committer and committer != author:
126 if committer and committer != author:
125 message += "\ncommitter: %s\n" % committer
127 message += "\ncommitter: %s\n" % committer
126 tzs, tzh, tzm = tz[-5:-4] + "1", tz[-4:-2], tz[-2:]
128 tzs, tzh, tzm = tz[-5:-4] + "1", tz[-4:-2], tz[-2:]
127 tz = -int(tzs) * (int(tzh) * 3600 + int(tzm))
129 tz = -int(tzs) * (int(tzh) * 3600 + int(tzm))
128 date = tm + " " + str(tz)
130 date = tm + " " + str(tz)
129
131
130 c = commit(parents=parents, date=date, author=author, desc=message,
132 c = commit(parents=parents, date=date, author=author, desc=message,
131 rev=version)
133 rev=version)
132 return c
134 return c
133
135
134 def gettags(self):
136 def gettags(self):
135 tags = {}
137 tags = {}
136 fh = self.gitopen('git ls-remote --tags "%s"' % self.path)
138 fh = self.gitopen('git ls-remote --tags "%s"' % self.path)
137 prefix = 'refs/tags/'
139 prefix = 'refs/tags/'
138 for line in fh:
140 for line in fh:
139 line = line.strip()
141 line = line.strip()
140 if not line.endswith("^{}"):
142 if not line.endswith("^{}"):
141 continue
143 continue
142 node, tag = line.split(None, 1)
144 node, tag = line.split(None, 1)
143 if not tag.startswith(prefix):
145 if not tag.startswith(prefix):
144 continue
146 continue
145 tag = tag[len(prefix):-3]
147 tag = tag[len(prefix):-3]
146 tags[tag] = node
148 tags[tag] = node
149 if fh.close():
150 raise util.Abort(_('cannot read tags from %s') % self.path)
147
151
148 return tags
152 return tags
149
153
150 def getchangedfiles(self, version, i):
154 def getchangedfiles(self, version, i):
151 changes = []
155 changes = []
152 if i is None:
156 if i is None:
153 fh = self.gitopen("git diff-tree --root -m -r %s" % version)
157 fh = self.gitopen("git diff-tree --root -m -r %s" % version)
154 for l in fh:
158 for l in fh:
155 if "\t" not in l:
159 if "\t" not in l:
156 continue
160 continue
157 m, f = l[:-1].split("\t")
161 m, f = l[:-1].split("\t")
158 changes.append(f)
162 changes.append(f)
159 fh.close()
160 else:
163 else:
161 fh = self.gitopen('git diff-tree --name-only --root -r %s "%s^%s" --'
164 fh = self.gitopen('git diff-tree --name-only --root -r %s "%s^%s" --'
162 % (version, version, i + 1))
165 % (version, version, i + 1))
163 changes = [f.rstrip('\n') for f in fh]
166 changes = [f.rstrip('\n') for f in fh]
164 fh.close()
167 if fh.close():
168 raise util.Abort(_('cannot read changes in %s') % version)
165
169
166 return changes
170 return changes
@@ -1,173 +1,186 b''
1 #!/bin/sh
1 #!/bin/sh
2
2
3 "$TESTDIR/hghave" git || exit 80
3 "$TESTDIR/hghave" git || exit 80
4
4
5 echo "[extensions]" >> $HGRCPATH
5 echo "[extensions]" >> $HGRCPATH
6 echo "convert=" >> $HGRCPATH
6 echo "convert=" >> $HGRCPATH
7 echo 'hgext.graphlog =' >> $HGRCPATH
7 echo 'hgext.graphlog =' >> $HGRCPATH
8
8
9 GIT_AUTHOR_NAME='test'; export GIT_AUTHOR_NAME
9 GIT_AUTHOR_NAME='test'; export GIT_AUTHOR_NAME
10 GIT_AUTHOR_EMAIL='test@example.org'; export GIT_AUTHOR_EMAIL
10 GIT_AUTHOR_EMAIL='test@example.org'; export GIT_AUTHOR_EMAIL
11 GIT_AUTHOR_DATE="2007-01-01 00:00:00 +0000"; export GIT_AUTHOR_DATE
11 GIT_AUTHOR_DATE="2007-01-01 00:00:00 +0000"; export GIT_AUTHOR_DATE
12 GIT_COMMITTER_NAME="$GIT_AUTHOR_NAME"; export GIT_COMMITTER_NAME
12 GIT_COMMITTER_NAME="$GIT_AUTHOR_NAME"; export GIT_COMMITTER_NAME
13 GIT_COMMITTER_EMAIL="$GIT_AUTHOR_EMAIL"; export GIT_COMMITTER_EMAIL
13 GIT_COMMITTER_EMAIL="$GIT_AUTHOR_EMAIL"; export GIT_COMMITTER_EMAIL
14 GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"; export GIT_COMMITTER_DATE
14 GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"; export GIT_COMMITTER_DATE
15
15
16 count=10
16 count=10
17 commit()
17 commit()
18 {
18 {
19 GIT_AUTHOR_DATE="2007-01-01 00:00:$count +0000"
19 GIT_AUTHOR_DATE="2007-01-01 00:00:$count +0000"
20 GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"
20 GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"
21 git commit "$@" >/dev/null 2>/dev/null || echo "git commit error"
21 git commit "$@" >/dev/null 2>/dev/null || echo "git commit error"
22 count=`expr $count + 1`
22 count=`expr $count + 1`
23 }
23 }
24
24
25 mkdir git-repo
25 mkdir git-repo
26 cd git-repo
26 cd git-repo
27 git init-db >/dev/null 2>/dev/null
27 git init-db >/dev/null 2>/dev/null
28 echo a > a
28 echo a > a
29 mkdir d
29 mkdir d
30 echo b > d/b
30 echo b > d/b
31 git add a d
31 git add a d
32 commit -a -m t1
32 commit -a -m t1
33
33
34 # Remove the directory, then try to replace it with a file
34 # Remove the directory, then try to replace it with a file
35 # (issue 754)
35 # (issue 754)
36 git rm -f d/b
36 git rm -f d/b
37 commit -m t2
37 commit -m t2
38 echo d > d
38 echo d > d
39 git add d
39 git add d
40 commit -m t3
40 commit -m t3
41
41
42 echo b >> a
42 echo b >> a
43 commit -a -m t4.1
43 commit -a -m t4.1
44
44
45 git checkout -b other HEAD~ >/dev/null 2>/dev/null
45 git checkout -b other HEAD~ >/dev/null 2>/dev/null
46 echo c > a
46 echo c > a
47 echo a >> a
47 echo a >> a
48 commit -a -m t4.2
48 commit -a -m t4.2
49
49
50 git checkout master >/dev/null 2>/dev/null
50 git checkout master >/dev/null 2>/dev/null
51 git pull --no-commit . other > /dev/null 2>/dev/null
51 git pull --no-commit . other > /dev/null 2>/dev/null
52 commit -m 'Merge branch other'
52 commit -m 'Merge branch other'
53 cd ..
53 cd ..
54
54
55 hg convert --datesort git-repo
55 hg convert --datesort git-repo
56 hg up -q -R git-repo-hg
56 hg up -q -R git-repo-hg
57 hg -R git-repo-hg tip -v
57 hg -R git-repo-hg tip -v
58
58
59 count=10
59 count=10
60 mkdir git-repo2
60 mkdir git-repo2
61 cd git-repo2
61 cd git-repo2
62 git init-db >/dev/null 2>/dev/null
62 git init-db >/dev/null 2>/dev/null
63
63
64 echo foo > foo
64 echo foo > foo
65 git add foo
65 git add foo
66 commit -a -m 'add foo'
66 commit -a -m 'add foo'
67
67
68 echo >> foo
68 echo >> foo
69 commit -a -m 'change foo'
69 commit -a -m 'change foo'
70
70
71 git checkout -b Bar HEAD~ >/dev/null 2>/dev/null
71 git checkout -b Bar HEAD~ >/dev/null 2>/dev/null
72 echo quux >> quux
72 echo quux >> quux
73 git add quux
73 git add quux
74 commit -a -m 'add quux'
74 commit -a -m 'add quux'
75
75
76 echo bar > bar
76 echo bar > bar
77 git add bar
77 git add bar
78 commit -a -m 'add bar'
78 commit -a -m 'add bar'
79
79
80 git checkout -b Baz HEAD~ >/dev/null 2>/dev/null
80 git checkout -b Baz HEAD~ >/dev/null 2>/dev/null
81 echo baz > baz
81 echo baz > baz
82 git add baz
82 git add baz
83 commit -a -m 'add baz'
83 commit -a -m 'add baz'
84
84
85 git checkout master >/dev/null 2>/dev/null
85 git checkout master >/dev/null 2>/dev/null
86 git pull --no-commit . Bar Baz > /dev/null 2>/dev/null
86 git pull --no-commit . Bar Baz > /dev/null 2>/dev/null
87 commit -m 'Octopus merge'
87 commit -m 'Octopus merge'
88
88
89 echo bar >> bar
89 echo bar >> bar
90 commit -a -m 'change bar'
90 commit -a -m 'change bar'
91
91
92 git checkout -b Foo HEAD~ >/dev/null 2>/dev/null
92 git checkout -b Foo HEAD~ >/dev/null 2>/dev/null
93 echo >> foo
93 echo >> foo
94 commit -a -m 'change foo'
94 commit -a -m 'change foo'
95
95
96 git checkout master >/dev/null 2>/dev/null
96 git checkout master >/dev/null 2>/dev/null
97 git pull --no-commit -s ours . Foo > /dev/null 2>/dev/null
97 git pull --no-commit -s ours . Foo > /dev/null 2>/dev/null
98 commit -m 'Discard change to foo'
98 commit -m 'Discard change to foo'
99
99
100 cd ..
100 cd ..
101
101
102 glog()
102 glog()
103 {
103 {
104 hg glog --template '{rev} "{desc|firstline}" files: {files}\n' "$@"
104 hg glog --template '{rev} "{desc|firstline}" files: {files}\n' "$@"
105 }
105 }
106
106
107 splitrepo()
107 splitrepo()
108 {
108 {
109 msg="$1"
109 msg="$1"
110 files="$2"
110 files="$2"
111 opts=$3
111 opts=$3
112 echo "% $files: $msg"
112 echo "% $files: $msg"
113 prefix=`echo "$files" | sed -e 's/ /-/g'`
113 prefix=`echo "$files" | sed -e 's/ /-/g'`
114 fmap="$prefix.fmap"
114 fmap="$prefix.fmap"
115 repo="$prefix.repo"
115 repo="$prefix.repo"
116 for i in $files; do
116 for i in $files; do
117 echo "include $i" >> "$fmap"
117 echo "include $i" >> "$fmap"
118 done
118 done
119 hg -q convert $opts --filemap "$fmap" --datesort git-repo2 "$repo"
119 hg -q convert $opts --filemap "$fmap" --datesort git-repo2 "$repo"
120 hg up -q -R "$repo"
120 hg up -q -R "$repo"
121 glog -R "$repo"
121 glog -R "$repo"
122 hg -R "$repo" manifest --debug
122 hg -R "$repo" manifest --debug
123 }
123 }
124
124
125 echo '% full conversion'
125 echo '% full conversion'
126 hg -q convert --datesort git-repo2 fullrepo
126 hg -q convert --datesort git-repo2 fullrepo
127 hg up -q -R fullrepo
127 hg up -q -R fullrepo
128 glog -R fullrepo
128 glog -R fullrepo
129 hg -R fullrepo manifest --debug
129 hg -R fullrepo manifest --debug
130
130
131 splitrepo 'octopus merge' 'foo bar baz'
131 splitrepo 'octopus merge' 'foo bar baz'
132
132
133 splitrepo 'only some parents of an octopus merge; "discard" a head' 'foo baz quux'
133 splitrepo 'only some parents of an octopus merge; "discard" a head' 'foo baz quux'
134
134
135 echo
135 echo
136 echo '% test binary conversion (issue 1359)'
136 echo '% test binary conversion (issue 1359)'
137 mkdir git-repo3
137 mkdir git-repo3
138 cd git-repo3
138 cd git-repo3
139 git init-db >/dev/null 2>/dev/null
139 git init-db >/dev/null 2>/dev/null
140 python -c 'file("b", "wb").write("".join([chr(i) for i in range(256)])*16)'
140 python -c 'file("b", "wb").write("".join([chr(i) for i in range(256)])*16)'
141 git add b
141 git add b
142 commit -a -m addbinary
142 commit -a -m addbinary
143 cd ..
143 cd ..
144
144
145 echo '% convert binary file'
145 echo '% convert binary file'
146 hg convert git-repo3 git-repo3-hg
146 hg convert git-repo3 git-repo3-hg
147
147
148 cd git-repo3-hg
148 cd git-repo3-hg
149 hg up -C
149 hg up -C
150 python -c 'print len(file("b", "rb").read())'
150 python -c 'print len(file("b", "rb").read())'
151 cd ..
151 cd ..
152
152
153 echo
153 echo
154 echo '% test author vs committer'
154 echo '% test author vs committer'
155 mkdir git-repo4
155 mkdir git-repo4
156 cd git-repo4
156 cd git-repo4
157 git init-db >/dev/null 2>/dev/null
157 git init-db >/dev/null 2>/dev/null
158 echo >> foo
158 echo >> foo
159 git add foo
159 git add foo
160 commit -a -m addfoo
160 commit -a -m addfoo
161 echo >> foo
161 echo >> foo
162 GIT_AUTHOR_NAME="nottest"
162 GIT_AUTHOR_NAME="nottest"
163 commit -a -m addfoo2
163 commit -a -m addfoo2
164 cd ..
164 cd ..
165
165
166 echo '% convert author committer'
166 echo '% convert author committer'
167 hg convert git-repo4 git-repo4-hg
167 hg convert git-repo4 git-repo4-hg
168 hg -R git-repo4-hg log -v
168 hg -R git-repo4-hg log -v
169
169
170 echo '% --sourceorder should fail'
170 echo '% --sourceorder should fail'
171 hg convert --sourcesort git-repo4 git-repo4-sourcesort-hg
171 hg convert --sourcesort git-repo4 git-repo4-sourcesort-hg
172
172
173 echo '% damage git repository and convert again'
174 cat > damage.py <<EOF
175 import os
176 for root, dirs, files in os.walk('git-repo4/.git/objects'):
177 if files:
178 path = os.path.join(root, files[0])
179 os.remove(path)
180 break
181 EOF
182 python damage.py
183 hg convert git-repo4 git-repo4-broken-hg 2>&1 | \
184 sed 's/fatal:.*/fatal: git error/g'
185
173 true
186 true
@@ -1,129 +1,137 b''
1 rm 'd/b'
1 rm 'd/b'
2 assuming destination git-repo-hg
2 assuming destination git-repo-hg
3 initializing destination git-repo-hg repository
3 initializing destination git-repo-hg repository
4 scanning source...
4 scanning source...
5 sorting...
5 sorting...
6 converting...
6 converting...
7 5 t1
7 5 t1
8 4 t2
8 4 t2
9 3 t3
9 3 t3
10 2 t4.1
10 2 t4.1
11 1 t4.2
11 1 t4.2
12 0 Merge branch other
12 0 Merge branch other
13 changeset: 5:c78094926be2
13 changeset: 5:c78094926be2
14 tag: tip
14 tag: tip
15 parent: 3:f5f5cb45432b
15 parent: 3:f5f5cb45432b
16 parent: 4:4e174f80c67c
16 parent: 4:4e174f80c67c
17 user: test <test@example.org>
17 user: test <test@example.org>
18 date: Mon Jan 01 00:00:15 2007 +0000
18 date: Mon Jan 01 00:00:15 2007 +0000
19 files: a
19 files: a
20 description:
20 description:
21 Merge branch other
21 Merge branch other
22
22
23
23
24 % full conversion
24 % full conversion
25 @ 9 "Discard change to foo" files: foo
25 @ 9 "Discard change to foo" files: foo
26 |\
26 |\
27 | o 8 "change foo" files: foo
27 | o 8 "change foo" files: foo
28 | |
28 | |
29 o | 7 "change bar" files: bar
29 o | 7 "change bar" files: bar
30 |/
30 |/
31 o 6 "(octopus merge fixup)" files:
31 o 6 "(octopus merge fixup)" files:
32 |\
32 |\
33 | o 5 "Octopus merge" files: baz
33 | o 5 "Octopus merge" files: baz
34 | |\
34 | |\
35 o | | 4 "add baz" files: baz
35 o | | 4 "add baz" files: baz
36 | | |
36 | | |
37 +---o 3 "add bar" files: bar
37 +---o 3 "add bar" files: bar
38 | |
38 | |
39 o | 2 "add quux" files: quux
39 o | 2 "add quux" files: quux
40 | |
40 | |
41 | o 1 "change foo" files: foo
41 | o 1 "change foo" files: foo
42 |/
42 |/
43 o 0 "add foo" files: foo
43 o 0 "add foo" files: foo
44
44
45 245a3b8bc653999c2b22cdabd517ccb47aecafdf 644 bar
45 245a3b8bc653999c2b22cdabd517ccb47aecafdf 644 bar
46 354ae8da6e890359ef49ade27b68bbc361f3ca88 644 baz
46 354ae8da6e890359ef49ade27b68bbc361f3ca88 644 baz
47 9277c9cc8dd4576fc01a17939b4351e5ada93466 644 foo
47 9277c9cc8dd4576fc01a17939b4351e5ada93466 644 foo
48 88dfeab657e8cf2cef3dec67b914f49791ae76b1 644 quux
48 88dfeab657e8cf2cef3dec67b914f49791ae76b1 644 quux
49 % foo bar baz: octopus merge
49 % foo bar baz: octopus merge
50 @ 8 "Discard change to foo" files: foo
50 @ 8 "Discard change to foo" files: foo
51 |\
51 |\
52 | o 7 "change foo" files: foo
52 | o 7 "change foo" files: foo
53 | |
53 | |
54 o | 6 "change bar" files: bar
54 o | 6 "change bar" files: bar
55 |/
55 |/
56 o 5 "(octopus merge fixup)" files:
56 o 5 "(octopus merge fixup)" files:
57 |\
57 |\
58 | o 4 "Octopus merge" files: baz
58 | o 4 "Octopus merge" files: baz
59 | |\
59 | |\
60 o | | 3 "add baz" files: baz
60 o | | 3 "add baz" files: baz
61 | | |
61 | | |
62 +---o 2 "add bar" files: bar
62 +---o 2 "add bar" files: bar
63 | |
63 | |
64 | o 1 "change foo" files: foo
64 | o 1 "change foo" files: foo
65 |/
65 |/
66 o 0 "add foo" files: foo
66 o 0 "add foo" files: foo
67
67
68 245a3b8bc653999c2b22cdabd517ccb47aecafdf 644 bar
68 245a3b8bc653999c2b22cdabd517ccb47aecafdf 644 bar
69 354ae8da6e890359ef49ade27b68bbc361f3ca88 644 baz
69 354ae8da6e890359ef49ade27b68bbc361f3ca88 644 baz
70 9277c9cc8dd4576fc01a17939b4351e5ada93466 644 foo
70 9277c9cc8dd4576fc01a17939b4351e5ada93466 644 foo
71 % foo baz quux: only some parents of an octopus merge; "discard" a head
71 % foo baz quux: only some parents of an octopus merge; "discard" a head
72 @ 6 "Discard change to foo" files: foo
72 @ 6 "Discard change to foo" files: foo
73 |
73 |
74 o 5 "change foo" files: foo
74 o 5 "change foo" files: foo
75 |
75 |
76 o 4 "Octopus merge" files:
76 o 4 "Octopus merge" files:
77 |\
77 |\
78 | o 3 "add baz" files: baz
78 | o 3 "add baz" files: baz
79 | |
79 | |
80 | o 2 "add quux" files: quux
80 | o 2 "add quux" files: quux
81 | |
81 | |
82 o | 1 "change foo" files: foo
82 o | 1 "change foo" files: foo
83 |/
83 |/
84 o 0 "add foo" files: foo
84 o 0 "add foo" files: foo
85
85
86 354ae8da6e890359ef49ade27b68bbc361f3ca88 644 baz
86 354ae8da6e890359ef49ade27b68bbc361f3ca88 644 baz
87 9277c9cc8dd4576fc01a17939b4351e5ada93466 644 foo
87 9277c9cc8dd4576fc01a17939b4351e5ada93466 644 foo
88 88dfeab657e8cf2cef3dec67b914f49791ae76b1 644 quux
88 88dfeab657e8cf2cef3dec67b914f49791ae76b1 644 quux
89
89
90 % test binary conversion (issue 1359)
90 % test binary conversion (issue 1359)
91 % convert binary file
91 % convert binary file
92 initializing destination git-repo3-hg repository
92 initializing destination git-repo3-hg repository
93 scanning source...
93 scanning source...
94 sorting...
94 sorting...
95 converting...
95 converting...
96 0 addbinary
96 0 addbinary
97 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
97 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
98 4096
98 4096
99
99
100 % test author vs committer
100 % test author vs committer
101 % convert author committer
101 % convert author committer
102 initializing destination git-repo4-hg repository
102 initializing destination git-repo4-hg repository
103 scanning source...
103 scanning source...
104 sorting...
104 sorting...
105 converting...
105 converting...
106 1 addfoo
106 1 addfoo
107 0 addfoo2
107 0 addfoo2
108 changeset: 1:d63e967f93da
108 changeset: 1:d63e967f93da
109 tag: tip
109 tag: tip
110 user: nottest <test@example.org>
110 user: nottest <test@example.org>
111 date: Mon Jan 01 00:00:21 2007 +0000
111 date: Mon Jan 01 00:00:21 2007 +0000
112 files: foo
112 files: foo
113 description:
113 description:
114 addfoo2
114 addfoo2
115
115
116 committer: test <test@example.org>
116 committer: test <test@example.org>
117
117
118
118
119 changeset: 0:0735477b0224
119 changeset: 0:0735477b0224
120 user: test <test@example.org>
120 user: test <test@example.org>
121 date: Mon Jan 01 00:00:20 2007 +0000
121 date: Mon Jan 01 00:00:20 2007 +0000
122 files: foo
122 files: foo
123 description:
123 description:
124 addfoo
124 addfoo
125
125
126
126
127 % --sourceorder should fail
127 % --sourceorder should fail
128 initializing destination git-repo4-sourcesort-hg repository
128 initializing destination git-repo4-sourcesort-hg repository
129 abort: --sourcesort is not supported by this data source
129 abort: --sourcesort is not supported by this data source
130 % damage git repository and convert again
131 fatal: git error
132 initializing destination git-repo4-broken-hg repository
133 scanning source...
134 sorting...
135 converting...
136 1 addfoo
137 abort: cannot read changes in 6a101ac3f6d8b2524a64295ffd9be87ed927bfeb
General Comments 0
You need to be logged in to leave comments. Login now