Show More
@@ -192,7 +192,7 b' class convert(object):' | |||||
192 | def copy(self, rev): |
|
192 | def copy(self, rev): | |
193 | c = self.commitcache[rev] |
|
193 | c = self.commitcache[rev] | |
194 | files = self.source.getchanges(rev) |
|
194 | files = self.source.getchanges(rev) | |
195 |
|
195 | |||
196 | do_copies = (hasattr(c, 'copies') and hasattr(self.dest, 'copyfile')) |
|
196 | do_copies = (hasattr(c, 'copies') and hasattr(self.dest, 'copyfile')) | |
197 |
|
197 | |||
198 | for f, v in files: |
|
198 | for f, v in files: |
@@ -60,7 +60,7 b' class converter_source(object):' | |||||
60 | def recode(self, s, encoding=None): |
|
60 | def recode(self, s, encoding=None): | |
61 | if not encoding: |
|
61 | if not encoding: | |
62 | encoding = self.encoding or 'utf-8' |
|
62 | encoding = self.encoding or 'utf-8' | |
63 |
|
63 | |||
64 | try: |
|
64 | try: | |
65 | return s.decode(encoding).encode("utf-8") |
|
65 | return s.decode(encoding).encode("utf-8") | |
66 | except: |
|
66 | except: |
@@ -58,7 +58,7 b' class convert_mercurial(converter_sink):' | |||||
58 | extra['branch'] = commit.branch |
|
58 | extra['branch'] = commit.branch | |
59 | if commit.rev: |
|
59 | if commit.rev: | |
60 | extra['convert_revision'] = commit.rev |
|
60 | extra['convert_revision'] = commit.rev | |
61 |
|
61 | |||
62 | while parents: |
|
62 | while parents: | |
63 | p1 = p2 |
|
63 | p1 = p2 | |
64 | p2 = parents.pop(0) |
|
64 | p2 = parents.pop(0) |
@@ -157,7 +157,7 b' class convert_svn(converter_source):' | |||||
157 | self.modecache[(file, rev)] = mode |
|
157 | self.modecache[(file, rev)] = mode | |
158 | return data |
|
158 | return data | |
159 |
|
159 | |||
160 |
def getmode(self, file, rev): |
|
160 | def getmode(self, file, rev): | |
161 | return self.modecache[(file, rev)] |
|
161 | return self.modecache[(file, rev)] | |
162 |
|
162 | |||
163 | def getchanges(self, rev): |
|
163 | def getchanges(self, rev): | |
@@ -449,7 +449,7 b' class convert_svn(converter_source):' | |||||
449 | # print "find children %s@%d from %d action %s" % (path, revnum, ent.copyfrom_rev, ent.action) |
|
449 | # print "find children %s@%d from %d action %s" % (path, revnum, ent.copyfrom_rev, ent.action) | |
450 | # Sometimes this is tricky. For example: in |
|
450 | # Sometimes this is tricky. For example: in | |
451 | # The Subversion Repository revision 6940 a dir |
|
451 | # The Subversion Repository revision 6940 a dir | |
452 |
# was copied and one of its files was deleted |
|
452 | # was copied and one of its files was deleted | |
453 | # from the new location in the same commit. This |
|
453 | # from the new location in the same commit. This | |
454 | # code can't deal with that yet. |
|
454 | # code can't deal with that yet. | |
455 | if ent.action == 'C': |
|
455 | if ent.action == 'C': | |
@@ -463,7 +463,7 b' class convert_svn(converter_source):' | |||||
463 | for child in children: |
|
463 | for child in children: | |
464 | # Can we move a child directory and its |
|
464 | # Can we move a child directory and its | |
465 | # parent in the same commit? (probably can). Could |
|
465 | # parent in the same commit? (probably can). Could | |
466 |
# cause problems if instead of revnum -1, |
|
466 | # cause problems if instead of revnum -1, | |
467 | # we have to look in (copyfrom_path, revnum - 1) |
|
467 | # we have to look in (copyfrom_path, revnum - 1) | |
468 | entrypath = get_entry_from_path("/" + child, module=old_module) |
|
468 | entrypath = get_entry_from_path("/" + child, module=old_module) | |
469 | if entrypath: |
|
469 | if entrypath: | |
@@ -493,7 +493,7 b' class convert_svn(converter_source):' | |||||
493 | for child in children: |
|
493 | for child in children: | |
494 | # Can we move a child directory and its |
|
494 | # Can we move a child directory and its | |
495 | # parent in the same commit? (probably can). Could |
|
495 | # parent in the same commit? (probably can). Could | |
496 |
# cause problems if instead of revnum -1, |
|
496 | # cause problems if instead of revnum -1, | |
497 | # we have to look in (copyfrom_path, revnum - 1) |
|
497 | # we have to look in (copyfrom_path, revnum - 1) | |
498 | entrypath = get_entry_from_path("/" + child, module=self.module) |
|
498 | entrypath = get_entry_from_path("/" + child, module=self.module) | |
499 | # print child, self.module, entrypath |
|
499 | # print child, self.module, entrypath | |
@@ -542,7 +542,7 b' class convert_svn(converter_source):' | |||||
542 |
|
542 | |||
543 | self.modulemap[revnum] = self.module # track backwards in time |
|
543 | self.modulemap[revnum] = self.module # track backwards in time | |
544 | # a list of (filename, id) where id lets us retrieve the file. |
|
544 | # a list of (filename, id) where id lets us retrieve the file. | |
545 |
# eg in git, id is the object hash. for svn it'll be the |
|
545 | # eg in git, id is the object hash. for svn it'll be the | |
546 | self.files[rev] = zip(entries, [rev] * len(entries)) |
|
546 | self.files[rev] = zip(entries, [rev] * len(entries)) | |
547 | if not entries: |
|
547 | if not entries: | |
548 | return |
|
548 | return | |
@@ -556,8 +556,8 b' class convert_svn(converter_source):' | |||||
556 | author = author and self.recode(author) or '' |
|
556 | author = author and self.recode(author) or '' | |
557 |
|
557 | |||
558 | cset = commit(author=author, |
|
558 | cset = commit(author=author, | |
559 |
date=util.datestr(date), |
|
559 | date=util.datestr(date), | |
560 |
desc=log, |
|
560 | desc=log, | |
561 | parents=parents, |
|
561 | parents=parents, | |
562 | copies=copies, |
|
562 | copies=copies, | |
563 | branch=branch, |
|
563 | branch=branch, | |
@@ -585,7 +585,7 b' class convert_svn(converter_source):' | |||||
585 | parselogentry(orig_paths, revnum, author, date, message) |
|
585 | parselogentry(orig_paths, revnum, author, date, message) | |
586 | except SubversionException, (_, num): |
|
586 | except SubversionException, (_, num): | |
587 | if num == svn.core.SVN_ERR_FS_NO_SUCH_REVISION: |
|
587 | if num == svn.core.SVN_ERR_FS_NO_SUCH_REVISION: | |
588 |
raise NoSuchRevision(branch=self, |
|
588 | raise NoSuchRevision(branch=self, | |
589 | revision="Revision number %d" % to_revnum) |
|
589 | revision="Revision number %d" % to_revnum) | |
590 | raise |
|
590 | raise | |
591 |
|
591 |
@@ -27,7 +27,7 b' import svn.ra' | |||||
27 | import svn.client |
|
27 | import svn.client | |
28 | import svn.core |
|
28 | import svn.core | |
29 |
|
29 | |||
30 |
# Some older versions of the Python bindings need to be |
|
30 | # Some older versions of the Python bindings need to be | |
31 | # explicitly initialized. But what we want to do probably |
|
31 | # explicitly initialized. But what we want to do probably | |
32 | # won't work worth a darn against those libraries anyway! |
|
32 | # won't work worth a darn against those libraries anyway! | |
33 | svn.ra.initialize() |
|
33 | svn.ra.initialize() | |
@@ -75,7 +75,7 b' class SvnRaTransport(object):' | |||||
75 | self.client.config = svn_config |
|
75 | self.client.config = svn_config | |
76 | try: |
|
76 | try: | |
77 | self.ra = svn.client.open_ra_session( |
|
77 | self.ra = svn.client.open_ra_session( | |
78 |
self.svn_url.encode('utf8'), |
|
78 | self.svn_url.encode('utf8'), | |
79 | self.client, self.pool) |
|
79 | self.client, self.pool) | |
80 | except SubversionException, (_, num): |
|
80 | except SubversionException, (_, num): | |
81 | if num in (svn.core.SVN_ERR_RA_ILLEGAL_URL, |
|
81 | if num in (svn.core.SVN_ERR_RA_ILLEGAL_URL, |
@@ -31,7 +31,7 b' from mercurial import hg, util' | |||||
31 | from mercurial.i18n import _ |
|
31 | from mercurial.i18n import _ | |
32 | import os |
|
32 | import os | |
33 |
|
33 | |||
34 |
def dopurge(ui, repo, dirs=None, act=True, ignored=False, |
|
34 | def dopurge(ui, repo, dirs=None, act=True, ignored=False, | |
35 | abort_on_err=False, eol='\n', |
|
35 | abort_on_err=False, eol='\n', | |
36 | force=False, include=None, exclude=None): |
|
36 | force=False, include=None, exclude=None): | |
37 | def error(msg): |
|
37 | def error(msg): |
@@ -244,7 +244,7 b' class hgwebdir(object):' | |||||
244 | if up < 0: |
|
244 | if up < 0: | |
245 | break |
|
245 | break | |
246 | virtual = virtual[:up] |
|
246 | virtual = virtual[:up] | |
247 |
|
247 | |||
248 | req.write(tmpl("notfound", repo=virtual)) |
|
248 | req.write(tmpl("notfound", repo=virtual)) | |
249 | else: |
|
249 | else: | |
250 | if req.form.has_key('static'): |
|
250 | if req.form.has_key('static'): |
@@ -39,7 +39,7 b' class _error_logger(object):' | |||||
39 | class _hgwebhandler(object, BaseHTTPServer.BaseHTTPRequestHandler): |
|
39 | class _hgwebhandler(object, BaseHTTPServer.BaseHTTPRequestHandler): | |
40 |
|
40 | |||
41 | url_scheme = 'http' |
|
41 | url_scheme = 'http' | |
42 |
|
42 | |||
43 | def __init__(self, *args, **kargs): |
|
43 | def __init__(self, *args, **kargs): | |
44 | self.protocol_version = 'HTTP/1.1' |
|
44 | self.protocol_version = 'HTTP/1.1' | |
45 | BaseHTTPServer.BaseHTTPRequestHandler.__init__(self, *args, **kargs) |
|
45 | BaseHTTPServer.BaseHTTPRequestHandler.__init__(self, *args, **kargs) | |
@@ -173,7 +173,7 b' class _hgwebhandler(object, BaseHTTPServ' | |||||
173 | class _shgwebhandler(_hgwebhandler): |
|
173 | class _shgwebhandler(_hgwebhandler): | |
174 |
|
174 | |||
175 | url_scheme = 'https' |
|
175 | url_scheme = 'https' | |
176 |
|
176 | |||
177 | def setup(self): |
|
177 | def setup(self): | |
178 | self.connection = self.request |
|
178 | self.connection = self.request | |
179 | self.rfile = socket._fileobject(self.request, "rb", self.rbufsize) |
|
179 | self.rfile = socket._fileobject(self.request, "rb", self.rbufsize) |
General Comments 0
You need to be logged in to leave comments.
Login now