Show More
@@ -50,7 +50,7 b' class converter_source(object):' | |||||
50 |
|
50 | |||
51 | def getchanges(self, version): |
|
51 | def getchanges(self, version): | |
52 | """Return sorted list of (filename, id) tuples for all files changed in rev. |
|
52 | """Return sorted list of (filename, id) tuples for all files changed in rev. | |
53 |
|
53 | |||
54 | id just tells us which revision to return in getfile(), e.g. in |
|
54 | id just tells us which revision to return in getfile(), e.g. in | |
55 | git it's an object hash.""" |
|
55 | git it's an object hash.""" | |
56 | raise NotImplementedError() |
|
56 | raise NotImplementedError() | |
@@ -252,7 +252,7 b' class convert_cvs(converter_source):' | |||||
252 | user, host, root = m.group(1), m.group(2), m.group(3) |
|
252 | user, host, root = m.group(1), m.group(2), m.group(3) | |
253 |
|
253 | |||
254 | if conntype != "pserver": |
|
254 | if conntype != "pserver": | |
255 |
if conntype == "rsh": |
|
255 | if conntype == "rsh": | |
256 | rsh = os.environ.get("CVS_RSH" or "rsh") |
|
256 | rsh = os.environ.get("CVS_RSH" or "rsh") | |
257 | if user: |
|
257 | if user: | |
258 | cmd = [rsh, '-l', user, host] + cmd |
|
258 | cmd = [rsh, '-l', user, host] + cmd |
@@ -1,7 +1,7 b'' | |||||
1 | # ASCII graph log extension for Mercurial |
|
1 | # ASCII graph log extension for Mercurial | |
2 | # |
|
2 | # | |
3 | # Copyright 2007 Joel Rosdahl <joel@rosdahl.net> |
|
3 | # Copyright 2007 Joel Rosdahl <joel@rosdahl.net> | |
4 |
# |
|
4 | # | |
5 | # This software may be used and distributed according to the terms of |
|
5 | # This software may be used and distributed according to the terms of | |
6 | # the GNU General Public License, incorporated herein by reference. |
|
6 | # the GNU General Public License, incorporated herein by reference. | |
7 |
|
7 |
@@ -83,12 +83,12 b' def _check_missing(ui, repo, missing, fo' | |||||
83 | dirstate.walk() can yield filenames different from the ones |
|
83 | dirstate.walk() can yield filenames different from the ones | |
84 | stored in the dirstate. This already confuses the status and |
|
84 | stored in the dirstate. This already confuses the status and | |
85 | add commands, but with purge this may cause data loss. |
|
85 | add commands, but with purge this may cause data loss. | |
86 |
|
86 | |||
87 | To prevent this, _check_missing will abort if there are missing |
|
87 | To prevent this, _check_missing will abort if there are missing | |
88 |
files. The force option will let the user skip the check if he |
|
88 | files. The force option will let the user skip the check if he | |
89 | knows it is safe. |
|
89 | knows it is safe. | |
90 |
|
90 | |||
91 |
Even with the force option this function will check if any of the |
|
91 | Even with the force option this function will check if any of the | |
92 | missing files is still available in the working dir: if so there |
|
92 | missing files is still available in the working dir: if so there | |
93 | may be some problem with the underlying filesystem, so it |
|
93 | may be some problem with the underlying filesystem, so it | |
94 | aborts unconditionally.""" |
|
94 | aborts unconditionally.""" |
@@ -336,7 +336,7 b' class transplanter:' | |||||
336 | inmsg = True |
|
336 | inmsg = True | |
337 | message.append(line) |
|
337 | message.append(line) | |
338 | return (node, user, date, '\n'.join(message), parents) |
|
338 | return (node, user, date, '\n'.join(message), parents) | |
339 |
|
339 | |||
340 | def log(self, user, date, message, p1, p2, merge=False): |
|
340 | def log(self, user, date, message, p1, p2, merge=False): | |
341 | '''journal changelog metadata for later recover''' |
|
341 | '''journal changelog metadata for later recover''' | |
342 |
|
342 |
@@ -901,7 +901,7 b' def debuginstall(ui):' | |||||
901 | fa = writetemp(a) |
|
901 | fa = writetemp(a) | |
902 | d = mdiff.unidiff(a, None, b, None, os.path.basename(fa)) |
|
902 | d = mdiff.unidiff(a, None, b, None, os.path.basename(fa)) | |
903 | fd = writetemp(d) |
|
903 | fd = writetemp(d) | |
904 |
|
904 | |||
905 | files = {} |
|
905 | files = {} | |
906 | try: |
|
906 | try: | |
907 | patch.patch(fd, ui, cwd=os.path.dirname(fa), files=files) |
|
907 | patch.patch(fd, ui, cwd=os.path.dirname(fa), files=files) | |
@@ -909,7 +909,7 b' def debuginstall(ui):' | |||||
909 | ui.write(_(" patch call failed:\n")) |
|
909 | ui.write(_(" patch call failed:\n")) | |
910 | ui.write(" " + str(e) + "\n") |
|
910 | ui.write(" " + str(e) + "\n") | |
911 | problems += 1 |
|
911 | problems += 1 | |
912 |
else: |
|
912 | else: | |
913 | if list(files) != [os.path.basename(fa)]: |
|
913 | if list(files) != [os.path.basename(fa)]: | |
914 | ui.write(_(" unexpected patch output!")) |
|
914 | ui.write(_(" unexpected patch output!")) | |
915 | ui.write(_(" (you may have an incompatible version of patch)\n")) |
|
915 | ui.write(_(" (you may have an incompatible version of patch)\n")) | |
@@ -919,7 +919,7 b' def debuginstall(ui):' | |||||
919 | ui.write(_(" patch test failed!")) |
|
919 | ui.write(_(" patch test failed!")) | |
920 | ui.write(_(" (you may have an incompatible version of patch)\n")) |
|
920 | ui.write(_(" (you may have an incompatible version of patch)\n")) | |
921 | problems += 1 |
|
921 | problems += 1 | |
922 |
|
922 | |||
923 | os.unlink(fa) |
|
923 | os.unlink(fa) | |
924 | os.unlink(fd) |
|
924 | os.unlink(fd) | |
925 |
|
925 | |||
@@ -2548,7 +2548,7 b' def tags(ui, repo):' | |||||
2548 | hexfunc = ui.debugflag and hex or short |
|
2548 | hexfunc = ui.debugflag and hex or short | |
2549 | for t, n in l: |
|
2549 | for t, n in l: | |
2550 | try: |
|
2550 | try: | |
2551 |
|
|
2551 | hn = hexfunc(n) | |
2552 | r = "%5d:%s" % (repo.changelog.rev(n), hexfunc(n)) |
|
2552 | r = "%5d:%s" % (repo.changelog.rev(n), hexfunc(n)) | |
2553 | except revlog.LookupError: |
|
2553 | except revlog.LookupError: | |
2554 | r = " ?:%s" % hn |
|
2554 | r = " ?:%s" % hn |
@@ -195,11 +195,11 b' def create_server(ui, repo):' | |||||
195 | pass |
|
195 | pass | |
196 |
|
196 | |||
197 | class MercurialHTTPServer(object, _mixin, BaseHTTPServer.HTTPServer): |
|
197 | class MercurialHTTPServer(object, _mixin, BaseHTTPServer.HTTPServer): | |
198 |
|
198 | |||
199 | # SO_REUSEADDR has broken semantics on windows |
|
199 | # SO_REUSEADDR has broken semantics on windows | |
200 | if os.name == 'nt': |
|
200 | if os.name == 'nt': | |
201 | allow_reuse_address = 0 |
|
201 | allow_reuse_address = 0 | |
202 |
|
202 | |||
203 | def __init__(self, *args, **kargs): |
|
203 | def __init__(self, *args, **kargs): | |
204 | BaseHTTPServer.HTTPServer.__init__(self, *args, **kargs) |
|
204 | BaseHTTPServer.HTTPServer.__init__(self, *args, **kargs) | |
205 | self.accesslog = accesslog |
|
205 | self.accesslog = accesslog |
@@ -208,7 +208,7 b' class httprepository(remoterepository):' | |||||
208 | # 1.0 here is the _protocol_ version |
|
208 | # 1.0 here is the _protocol_ version | |
209 | opener.addheaders = [('User-agent', 'mercurial/proto-1.0')] |
|
209 | opener.addheaders = [('User-agent', 'mercurial/proto-1.0')] | |
210 | urllib2.install_opener(opener) |
|
210 | urllib2.install_opener(opener) | |
211 |
|
211 | |||
212 | def __del__(self): |
|
212 | def __del__(self): | |
213 | if self.handler: |
|
213 | if self.handler: | |
214 | self.handler.close_all() |
|
214 | self.handler.close_all() |
@@ -651,8 +651,8 b' class localrepository(repo.repository):' | |||||
651 | cp = self.dirstate.copied(fn) |
|
651 | cp = self.dirstate.copied(fn) | |
652 | if cp: |
|
652 | if cp: | |
653 | # Mark the new revision of this file as a copy of another |
|
653 | # Mark the new revision of this file as a copy of another | |
654 |
# file. This copy data will effectively act as a parent |
|
654 | # file. This copy data will effectively act as a parent | |
655 |
# of this new revision. If this is a merge, the first |
|
655 | # of this new revision. If this is a merge, the first | |
656 | # parent will be the nullid (meaning "look up the copy data") |
|
656 | # parent will be the nullid (meaning "look up the copy data") | |
657 | # and the second one will be the other parent. For example: |
|
657 | # and the second one will be the other parent. For example: | |
658 | # |
|
658 | # |
@@ -305,7 +305,7 b' def patch(patchname, ui, strip=1, cwd=No' | |||||
305 | raise util.Abort(_('no patch command found in hgrc or PATH')) |
|
305 | raise util.Abort(_('no patch command found in hgrc or PATH')) | |
306 | if util.needbinarypatch(): |
|
306 | if util.needbinarypatch(): | |
307 | args.append('--binary') |
|
307 | args.append('--binary') | |
308 |
|
308 | |||
309 | if cwd: |
|
309 | if cwd: | |
310 | args.append('-d %s' % util.shellquote(cwd)) |
|
310 | args.append('-d %s' % util.shellquote(cwd)) | |
311 | fp = os.popen('%s %s -p%d < %s' % (patcher, ' '.join(args), strip, |
|
311 | fp = os.popen('%s %s -p%d < %s' % (patcher, ' '.join(args), strip, |
@@ -823,7 +823,7 b" if os.name == 'nt':" | |||||
823 | if inst.errno != 0: raise |
|
823 | if inst.errno != 0: raise | |
824 | self.close() |
|
824 | self.close() | |
825 | raise IOError(errno.EPIPE, 'Broken pipe') |
|
825 | raise IOError(errno.EPIPE, 'Broken pipe') | |
826 |
|
826 | |||
827 | def flush(self): |
|
827 | def flush(self): | |
828 | try: |
|
828 | try: | |
829 | return self.fp.flush() |
|
829 | return self.fp.flush() | |
@@ -912,7 +912,7 b" if os.name == 'nt':" | |||||
912 | # username and groupname functions above, too. |
|
912 | # username and groupname functions above, too. | |
913 | def isowner(fp, st=None): |
|
913 | def isowner(fp, st=None): | |
914 | return True |
|
914 | return True | |
915 |
|
915 | |||
916 | def find_in_path(name, path, default=None): |
|
916 | def find_in_path(name, path, default=None): | |
917 | '''find name in search path. path can be string (will be split |
|
917 | '''find name in search path. path can be string (will be split | |
918 | with os.pathsep), or iterable thing that returns strings. if name |
|
918 | with os.pathsep), or iterable thing that returns strings. if name | |
@@ -920,17 +920,17 b" if os.name == 'nt':" | |||||
920 | using cmd.exe rules, using PATHEXT.''' |
|
920 | using cmd.exe rules, using PATHEXT.''' | |
921 | if isinstance(path, str): |
|
921 | if isinstance(path, str): | |
922 | path = path.split(os.pathsep) |
|
922 | path = path.split(os.pathsep) | |
923 |
|
923 | |||
924 | pathext = os.environ.get('PATHEXT', '.COM;.EXE;.BAT;.CMD') |
|
924 | pathext = os.environ.get('PATHEXT', '.COM;.EXE;.BAT;.CMD') | |
925 | pathext = pathext.lower().split(os.pathsep) |
|
925 | pathext = pathext.lower().split(os.pathsep) | |
926 | isexec = os.path.splitext(name)[1].lower() in pathext |
|
926 | isexec = os.path.splitext(name)[1].lower() in pathext | |
927 |
|
927 | |||
928 | for p in path: |
|
928 | for p in path: | |
929 | p_name = os.path.join(p, name) |
|
929 | p_name = os.path.join(p, name) | |
930 |
|
930 | |||
931 | if isexec and os.path.exists(p_name): |
|
931 | if isexec and os.path.exists(p_name): | |
932 | return p_name |
|
932 | return p_name | |
933 |
|
933 | |||
934 | for ext in pathext: |
|
934 | for ext in pathext: | |
935 | p_name_ext = p_name + ext |
|
935 | p_name_ext = p_name + ext | |
936 | if os.path.exists(p_name_ext): |
|
936 | if os.path.exists(p_name_ext): | |
@@ -1074,7 +1074,7 b' else:' | |||||
1074 | if st is None: |
|
1074 | if st is None: | |
1075 | st = fstat(fp) |
|
1075 | st = fstat(fp) | |
1076 | return st.st_uid == os.getuid() |
|
1076 | return st.st_uid == os.getuid() | |
1077 |
|
1077 | |||
1078 | def find_in_path(name, path, default=None): |
|
1078 | def find_in_path(name, path, default=None): | |
1079 | '''find name in search path. path can be string (will be split |
|
1079 | '''find name in search path. path can be string (will be split | |
1080 | with os.pathsep), or iterable thing that returns strings. if name |
|
1080 | with os.pathsep), or iterable thing that returns strings. if name |
@@ -38,7 +38,7 b' def split_lines(t):' | |||||
38 | # common base |
|
38 | # common base | |
39 | TZU = split_lines(""" The Nameless is the origin of Heaven and Earth; |
|
39 | TZU = split_lines(""" The Nameless is the origin of Heaven and Earth; | |
40 | The named is the mother of all things. |
|
40 | The named is the mother of all things. | |
41 |
|
41 | |||
42 | Therefore let there always be non-being, |
|
42 | Therefore let there always be non-being, | |
43 | so we may see their subtlety, |
|
43 | so we may see their subtlety, | |
44 | And let there always be being, |
|
44 | And let there always be being, | |
@@ -69,7 +69,7 b' TAO = split_lines(""" The Way that c' | |||||
69 | The name that can be named is not the eternal name. |
|
69 | The name that can be named is not the eternal name. | |
70 | The Nameless is the origin of Heaven and Earth; |
|
70 | The Nameless is the origin of Heaven and Earth; | |
71 | The named is the mother of all things. |
|
71 | The named is the mother of all things. | |
72 |
|
72 | |||
73 | Therefore let there always be non-being, |
|
73 | Therefore let there always be non-being, | |
74 | so we may see their subtlety, |
|
74 | so we may see their subtlety, | |
75 | And let there always be being, |
|
75 | And let there always be being, | |
@@ -77,7 +77,7 b' TAO = split_lines(""" The Way that c' | |||||
77 | The two are the same, |
|
77 | The two are the same, | |
78 | But after they are produced, |
|
78 | But after they are produced, | |
79 | they have different names. |
|
79 | they have different names. | |
80 |
|
80 | |||
81 | -- The Way of Lao-Tzu, tr. Wing-tsit Chan |
|
81 | -- The Way of Lao-Tzu, tr. Wing-tsit Chan | |
82 |
|
82 | |||
83 | """) |
|
83 | """) | |
@@ -95,7 +95,7 b' MERGED_RESULT = split_lines(""" The ' | |||||
95 | they have different names. |
|
95 | they have different names. | |
96 | <<<<<<< LAO |
|
96 | <<<<<<< LAO | |
97 | ======= |
|
97 | ======= | |
98 |
|
98 | |||
99 | -- The Way of Lao-Tzu, tr. Wing-tsit Chan |
|
99 | -- The Way of Lao-Tzu, tr. Wing-tsit Chan | |
100 |
|
100 | |||
101 | >>>>>>> TAO |
|
101 | >>>>>>> TAO | |
@@ -144,7 +144,7 b' class TestMerge3(TestCase):' | |||||
144 | self.assertEquals(list(m3.merge_groups()), |
|
144 | self.assertEquals(list(m3.merge_groups()), | |
145 | [('a', ['aaa', 'bbb']), |
|
145 | [('a', ['aaa', 'bbb']), | |
146 | ('unchanged', ['zz'])]) |
|
146 | ('unchanged', ['zz'])]) | |
147 |
|
147 | |||
148 | def test_null_insert(self): |
|
148 | def test_null_insert(self): | |
149 | m3 = Merge3([], |
|
149 | m3 = Merge3([], | |
150 | ['aaa', 'bbb'], |
|
150 | ['aaa', 'bbb'], | |
@@ -235,7 +235,7 b' 333' | |||||
235 | mid_marker='--', |
|
235 | mid_marker='--', | |
236 | end_marker='>>') |
|
236 | end_marker='>>') | |
237 | self.assertEquals(''.join(ml), 'aaa\n222\nbbb\n') |
|
237 | self.assertEquals(''.join(ml), 'aaa\n222\nbbb\n') | |
238 |
|
238 | |||
239 |
|
239 | |||
240 | def test_insert_clash(self): |
|
240 | def test_insert_clash(self): | |
241 | """Both try to insert lines in the same place.""" |
|
241 | """Both try to insert lines in the same place.""" | |
@@ -370,7 +370,7 b' bbb' | |||||
370 | this_text = ("a\n"*10+"b\n" * 10).splitlines(True) |
|
370 | this_text = ("a\n"*10+"b\n" * 10).splitlines(True) | |
371 | other_text = ("a\n"*10+"c\n"+"b\n" * 8 + "c\n").splitlines(True) |
|
371 | other_text = ("a\n"*10+"c\n"+"b\n" * 8 + "c\n").splitlines(True) | |
372 | m3 = Merge3(base_text, other_text, this_text) |
|
372 | m3 = Merge3(base_text, other_text, this_text) | |
373 |
m_lines = m3.merge_lines('OTHER', 'THIS', reprocess=True, |
|
373 | m_lines = m3.merge_lines('OTHER', 'THIS', reprocess=True, | |
374 | base_marker='|||||||') |
|
374 | base_marker='|||||||') | |
375 | self.assertRaises(CantReprocessAndShowBase, list, m_lines) |
|
375 | self.assertRaises(CantReprocessAndShowBase, list, m_lines) | |
376 |
|
376 |
@@ -155,7 +155,7 b" print 'untrusted:'" | |||||
155 | print u2.config('foobar', 'baz', untrusted=True) |
|
155 | print u2.config('foobar', 'baz', untrusted=True) | |
156 | print u2.config('paths', 'interpolated', untrusted=True) |
|
156 | print u2.config('paths', 'interpolated', untrusted=True) | |
157 |
|
157 | |||
158 |
print |
|
158 | ||
159 | print "# error handling" |
|
159 | print "# error handling" | |
160 |
|
160 | |||
161 | def assertraises(f, exc=util.Abort): |
|
161 | def assertraises(f, exc=util.Abort): |
General Comments 0
You need to be logged in to leave comments.
Login now