##// END OF EJS Templates
use documented convert-repo interface
Daniel Holth -
r4448:af013ae3 default
parent child Browse files
Show More
@@ -30,7 +30,7 b' from mercurial import hg, ui, util, fanc'
30 class Abort(Exception): pass
30 class Abort(Exception): pass
31 class NoRepo(Exception): pass
31 class NoRepo(Exception): pass
32
32
33 class commit:
33 class commit(object):
34 def __init__(self, **parts):
34 def __init__(self, **parts):
35 for x in "author date desc parents".split():
35 for x in "author date desc parents".split():
36 if not x in parts:
36 if not x in parts:
@@ -56,7 +56,7 b' def recode(s):'
56 except:
56 except:
57 return s.decode("utf-8", "replace").encode("utf-8")
57 return s.decode("utf-8", "replace").encode("utf-8")
58
58
59 class converter_source:
59 class converter_source(object):
60 """Conversion source interface"""
60 """Conversion source interface"""
61
61
62 def __init__(self, path):
62 def __init__(self, path):
@@ -91,7 +91,7 b' class converter_source:'
91 """Return the tags as a dictionary of name: revision"""
91 """Return the tags as a dictionary of name: revision"""
92 raise NotImplementedError()
92 raise NotImplementedError()
93
93
94 class converter_sink:
94 class converter_sink(object):
95 """Conversion sink (target) interface"""
95 """Conversion sink (target) interface"""
96
96
97 def __init__(self, path):
97 def __init__(self, path):
@@ -138,7 +138,7 b' class converter_sink:'
138
138
139
139
140 # CVS conversion code inspired by hg-cvs-import and git-cvsimport
140 # CVS conversion code inspired by hg-cvs-import and git-cvsimport
141 class convert_cvs:
141 class convert_cvs(converter_source):
142 def __init__(self, path):
142 def __init__(self, path):
143 self.path = path
143 self.path = path
144 cvs = os.path.join(path, "CVS")
144 cvs = os.path.join(path, "CVS")
@@ -369,7 +369,7 b' class convert_cvs:'
369 def gettags(self):
369 def gettags(self):
370 return self.tags
370 return self.tags
371
371
372 class convert_git:
372 class convert_git(converter_source):
373 def __init__(self, path):
373 def __init__(self, path):
374 if os.path.isdir(path + "/.git"):
374 if os.path.isdir(path + "/.git"):
375 path += "/.git"
375 path += "/.git"
@@ -455,7 +455,7 b' class convert_git:'
455
455
456 return tags
456 return tags
457
457
458 class convert_mercurial:
458 class convert_mercurial(converter_sink):
459 def __init__(self, path):
459 def __init__(self, path):
460 self.path = path
460 self.path = path
461 u = ui.ui()
461 u = ui.ui()
@@ -552,7 +552,7 b' def converter(path):'
552 pass
552 pass
553 abort("%s: unknown repository type\n" % path)
553 abort("%s: unknown repository type\n" % path)
554
554
555 class convert:
555 class convert(object):
556 def __init__(self, source, dest, mapfile, opts):
556 def __init__(self, source, dest, mapfile, opts):
557
557
558 self.source = source
558 self.source = source
General Comments 0
You need to be logged in to leave comments. Login now