Show More
@@ -14,7 +14,7 b' class convert_git(converter_source):' | |||||
14 | prevgitdir = os.environ.get('GIT_DIR') |
|
14 | prevgitdir = os.environ.get('GIT_DIR') | |
15 | os.environ['GIT_DIR'] = self.path |
|
15 | os.environ['GIT_DIR'] = self.path | |
16 | try: |
|
16 | try: | |
17 | return util.popen(s) |
|
17 | return util.popen(s, 'rb') | |
18 | finally: |
|
18 | finally: | |
19 | if prevgitdir is None: |
|
19 | if prevgitdir is None: | |
20 | del os.environ['GIT_DIR'] |
|
20 | del os.environ['GIT_DIR'] | |
@@ -22,7 +22,7 b' class convert_git(converter_source):' | |||||
22 | os.environ['GIT_DIR'] = prevgitdir |
|
22 | os.environ['GIT_DIR'] = prevgitdir | |
23 | else: |
|
23 | else: | |
24 | def gitcmd(self, s): |
|
24 | def gitcmd(self, s): | |
25 | return util.popen('GIT_DIR=%s %s' % (self.path, s)) |
|
25 | return util.popen('GIT_DIR=%s %s' % (self.path, s), 'rb') | |
26 |
|
26 | |||
27 | def __init__(self, ui, path, rev=None): |
|
27 | def __init__(self, ui, path, rev=None): | |
28 | super(convert_git, self).__init__(ui, path, rev=rev) |
|
28 | super(convert_git, self).__init__(ui, path, rev=rev) |
@@ -132,3 +132,20 b" 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 | |||
|
136 | echo '% test binary conversion (issue 1359)' | |||
|
137 | mkdir git-repo3 | |||
|
138 | cd git-repo3 | |||
|
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)' | |||
|
141 | git add b | |||
|
142 | commit -a -m addbinary | |||
|
143 | cd .. | |||
|
144 | ||||
|
145 | echo '% convert binary file' | |||
|
146 | hg convert git-repo3 git-repo3-hg | |||
|
147 | ||||
|
148 | cd git-repo3-hg | |||
|
149 | hg up -C | |||
|
150 | python -c 'print len(file("b", "rb").read())' | |||
|
151 |
@@ -88,3 +88,13 b' o 0 "add foo" files: foo' | |||||
88 | 354ae8da6e890359ef49ade27b68bbc361f3ca88 644 baz |
|
88 | 354ae8da6e890359ef49ade27b68bbc361f3ca88 644 baz | |
89 | 9277c9cc8dd4576fc01a17939b4351e5ada93466 644 foo |
|
89 | 9277c9cc8dd4576fc01a17939b4351e5ada93466 644 foo | |
90 | 88dfeab657e8cf2cef3dec67b914f49791ae76b1 644 quux |
|
90 | 88dfeab657e8cf2cef3dec67b914f49791ae76b1 644 quux | |
|
91 | ||||
|
92 | % test binary conversion (issue 1359) | |||
|
93 | % convert binary file | |||
|
94 | initializing destination git-repo3-hg repository | |||
|
95 | scanning source... | |||
|
96 | sorting... | |||
|
97 | converting... | |||
|
98 | 0 addbinary | |||
|
99 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
100 | 4096 |
General Comments 0
You need to be logged in to leave comments.
Login now