Changeset edff140c9cdb…
Parent 2969e5a9ada6…
by
Changes to 2 files · Browse files at edff140c9cdb Showing diff from parent 2969e5a9ada6 Diff from another changeset...
@@ -828,7 +828,7 @@ revs = cmdutil.revrange(self.repo, ['tip'])
fp = cStringIO.StringIO()
opts = patch.diffopts(self.ui, self.opts)
- cmdutil.export(self.repo, revs, fp=fp, opts=opts)
+ hglib.export(self.repo, revs, fp=fp, opts=opts)
text = fp.getvalue().splitlines(True)
buf = self.diff_highlight_buffer(text)
self.patch_text.set_buffer(buf)
|
@@ -11,7 +11,7 @@ import time
import inspect
-from mercurial import ui, util, extensions, match, bundlerepo, url
+from mercurial import ui, util, extensions, match, bundlerepo, url, cmdutil
from mercurial import dispatch, encoding, templatefilters, filemerge
_encoding = encoding.encoding
@@ -452,3 +452,17 @@ return hasattr(cls.__dict__[attr], '__get__')
return None
+def export(repo, revs, template='hg-%h.patch', fp=None, switch_parent=False,
+ opts=None):
+ '''
+ export changesets as hg patches.
+
+ Mercurial moved patch.export to cmdutil.export after version 1.5
+ (change e764f24a45ee in mercurial).
+ '''
+
+ try:
+ return cmdutil.export(repo, revs, template, fp, switch_parent, opts)
+ except AttributeError:
+ from mercurial import patch
+ return patch.export(repo, revs, template, fp, switch_parent, opts)
|
Loading...