Mercurial > public > mercurial-scm > hg
diff hgext/convert/common.py @ 35176:671aba341d90
convert: save an indicator of the repo type for sources and sinks
This seems like basic info to have, and will be used shortly when deciding
whether or not to wrap the class for lfs conversions.
The other option is to just add a function to each class. But this seems better
in that the strings aren't duplicated, and the constructor for most of these
will run even if the VCS isn't installed, so it's easier to catch errors.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Wed, 22 Nov 2017 20:49:01 -0500 |
parents | 5adbd3806ef7 |
children | 42a393ea56d2 |
line wrap: on
line diff
--- a/hgext/convert/common.py Wed Nov 15 23:43:15 2017 -0500 +++ b/hgext/convert/common.py Wed Nov 22 20:49:01 2017 -0500 @@ -73,12 +73,13 @@ class converter_source(object): """Conversion source interface""" - def __init__(self, ui, path=None, revs=None): + def __init__(self, ui, repotype, path=None, revs=None): """Initialize conversion source (or raise NoRepo("message") exception if path is not a valid repository)""" self.ui = ui self.path = path self.revs = revs + self.repotype = repotype self.encoding = 'utf-8' @@ -218,7 +219,7 @@ class converter_sink(object): """Conversion sink (target) interface""" - def __init__(self, ui, path): + def __init__(self, ui, repotype, path): """Initialize conversion sink (or raise NoRepo("message") exception if path is not a valid repository) @@ -227,6 +228,7 @@ self.ui = ui self.path = path self.created = [] + self.repotype = repotype def revmapfile(self): """Path to a file that will contain lines