summaryrefslogtreecommitdiff
path: root/exporter.py
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2011-10-25 16:21:02 -0700
committerJelmer Vernooij <jelmer@samba.org>2011-10-25 16:21:02 -0700
commite4e439b7bba4b6e26bfd2cc4904242ea120aace5 (patch)
tree33eda181643612733005dab9ffd735b554e724b4 /exporter.py
parente39c9988cfa62242be63b003c4b4cbcf3dce5e79 (diff)
downloadbzr-fastimport-e4e439b7bba4b6e26bfd2cc4904242ea120aace5.tar.gz
Some refactoring of exporter.
Diffstat (limited to 'exporter.py')
-rw-r--r--exporter.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/exporter.py b/exporter.py
index 7848c52..e4b5132 100644
--- a/exporter.py
+++ b/exporter.py
@@ -143,9 +143,10 @@ def sanitize_ref_name_for_git(refname):
"_", refname)
return new_refname
+
class BzrFastExporter(object):
- def __init__(self, source, destination, git_branch=None, checkpoint=-1,
+ def __init__(self, source, outf, git_branch=None, checkpoint=-1,
import_marks_file=None, export_marks_file=None, revision=None,
verbose=False, plain_format=False, rewrite_tags=False):
"""Export branch data in fast import format.
@@ -159,8 +160,8 @@ class BzrFastExporter(object):
Otherwise tags which aren't valid for git will be skipped if
plain_format is set.
"""
- self.source = source
- self.outf = _get_output_stream(destination)
+ self.branch = source
+ self.outf = outf
self.git_branch = git_branch
self.checkpoint = checkpoint
self.import_marks_file = import_marks_file
@@ -215,9 +216,6 @@ class BzrFastExporter(object):
return list(view_revisions)
def run(self):
- # Open the source
- self.branch = bzrlib.branch.Branch.open_containing(self.source)[0]
-
# Export the data
self.branch.repository.lock_read()
try: