Mercurial > hg
comparison hgext/shelve.py @ 21063:7ca4f2049d3b
bundle2: move `readbundle` into the `exchange` module
The `readbundle` function is going to understand the bundle2 header. We move the
function to a more suitable place before making any other changes.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Mon, 14 Apr 2014 15:33:50 -0400 |
parents | 2778616de7ce |
children | 4d9d490d7bbe |
comparison
equal
deleted
inserted
replaced
21062:e7c0a65a5c9c | 21063:7ca4f2049d3b |
---|---|
23 | 23 |
24 from mercurial.i18n import _ | 24 from mercurial.i18n import _ |
25 from mercurial.node import nullid, nullrev, bin, hex | 25 from mercurial.node import nullid, nullrev, bin, hex |
26 from mercurial import changegroup, cmdutil, scmutil, phases, commands | 26 from mercurial import changegroup, cmdutil, scmutil, phases, commands |
27 from mercurial import error, hg, mdiff, merge, patch, repair, util | 27 from mercurial import error, hg, mdiff, merge, patch, repair, util |
28 from mercurial import templatefilters, changegroup | 28 from mercurial import templatefilters, changegroup, exchange |
29 from mercurial import lock as lockmod | 29 from mercurial import lock as lockmod |
30 from hgext import rebase | 30 from hgext import rebase |
31 import errno | 31 import errno |
32 | 32 |
33 cmdtable = {} | 33 cmdtable = {} |
69 raise util.Abort(_("shelved change '%s' not found") % self.name) | 69 raise util.Abort(_("shelved change '%s' not found") % self.name) |
70 | 70 |
71 def applybundle(self): | 71 def applybundle(self): |
72 fp = self.opener() | 72 fp = self.opener() |
73 try: | 73 try: |
74 gen = changegroup.readbundle(fp, self.fname, self.vfs) | 74 gen = exchange.readbundle(fp, self.fname, self.vfs) |
75 changegroup.addchangegroup(self.repo, gen, 'unshelve', | 75 changegroup.addchangegroup(self.repo, gen, 'unshelve', |
76 'bundle:' + self.vfs.join(self.fname)) | 76 'bundle:' + self.vfs.join(self.fname)) |
77 finally: | 77 finally: |
78 fp.close() | 78 fp.close() |
79 | 79 |