Files
MSYS2-packages/bzr-fastimport/helpers.patch
2015-01-27 16:43:29 +03:00

89 lines
3.6 KiB
Diff

diff -rupN bzr-fastimport-orig/branch_updater.py bzr-fastimport-0.13.0/branch_updater.py
--- bzr-fastimport-orig/branch_updater.py 2012-02-29 11:50:32.000000000 +0000
+++ bzr-fastimport-0.13.0/branch_updater.py 2014-04-03 15:43:55.373988397 +0100
@@ -149,7 +149,6 @@ class BranchUpdater(object):
:return: whether the branch was changed or not
"""
- from fastimport.helpers import single_plural
last_rev_id = self.cache_mgr.lookup_committish(last_mark)
self.repo.lock_read()
try:
@@ -174,7 +173,6 @@ class BranchUpdater(object):
changed = True
if changed:
tagno = len(my_tags)
- note("\t branch %s now has %d %s and %d %s", br.nick,
- revno, single_plural(revno, "revision", "revisions"),
- tagno, single_plural(tagno, "tag", "tags"))
+ note("\t branch %s now has %d %s and %d %s", br.nick, \
+ revno, "revision(s)", tagno, "tag(s)")
return changed
diff -rupN bzr-fastimport-orig/cache_manager.py bzr-fastimport-0.13.0/cache_manager.py
--- bzr-fastimport-orig/cache_manager.py 2012-02-29 11:50:32.000000000 +0000
+++ bzr-fastimport-0.13.0/cache_manager.py 2014-04-03 15:45:23.402088096 +0100
@@ -28,9 +28,6 @@ from bzrlib.plugins.fastimport import (
from bzrlib.plugins.fastimport.reftracker import (
RefTracker,
)
-from fastimport.helpers import (
- single_plural,
- )
class _Cleanup(object):
@@ -162,8 +159,7 @@ class CacheManager(object):
if size > 1024:
size = size / 1024
unit = 'G'
- note(" %-12s: %8.1f %s (%d %s)" % (label, size, unit, count,
- single_plural(count, "item", "items")))
+ note(" %-12s: %8.1f %s (%d %s)" % (label, size, unit, count, "item(s)"))
def clear_all(self):
"""Free up any memory used by the caches."""
diff -rupN bzr-fastimport-orig/cmds.py bzr-fastimport-0.13.0/cmds.py
--- bzr-fastimport-orig/cmds.py 2012-02-29 11:50:32.000000000 +0000
+++ bzr-fastimport-0.13.0/cmds.py 2014-04-03 15:47:43.074360586 +0100
@@ -42,8 +42,7 @@ def _run(source, processor_factory, verb
def _get_source_stream(source):
if source == '-' or source is None:
import sys
- from fastimport import helpers
- stream = helpers.binary_stream(sys.stdin)
+ stream = sys.stdin
elif source.endswith('.gz'):
import gzip
stream = gzip.open(source, "rb")
diff -rupN bzr-fastimport-orig/exporter.py bzr-fastimport-0.13.0/exporter.py
--- bzr-fastimport-orig/exporter.py 2012-02-29 11:50:32.000000000 +0000
+++ bzr-fastimport-0.13.0/exporter.py 2014-04-03 15:48:27.075076168 +0100
@@ -64,15 +64,11 @@ from bzrlib.plugins.fastimport import (
)
from fastimport import commands
-from fastimport.helpers import (
- binary_stream,
- single_plural,
- )
def _get_output_stream(destination):
if destination is None or destination == '-':
- return binary_stream(sys.stdout)
+ return sys.stdout
elif destination.endswith('gz'):
import gzip
return gzip.open(destination, 'wb')
@@ -277,9 +273,7 @@ class BzrFastExporter(object):
def dump_stats(self):
time_required = progress.str_tdelta(time.time() - self._start_time)
rc = len(self.revid_to_mark)
- self.note("Exported %d %s in %s",
- rc, single_plural(rc, "revision", "revisions"),
- time_required)
+ self.note("Exported %d %s in %s", rc, "revision(s)", time_required)
def print_cmd(self, cmd):
self.outf.write("%r\n" % cmd)