##// END OF EJS Templates
shelve: use absolute_import
timeless -
r28378:96a7368a default
parent child Browse files
Show More
@@ -20,17 +20,36 b' You can have more than one shelved chang'
20 20 shelved change has a distinct name. For details, see the help for "hg
21 21 shelve".
22 22 """
23 from __future__ import absolute_import
23 24
24 25 import collections
26 import errno
25 27 import itertools
28 from mercurial import (
29 bundle2,
30 bundlerepo,
31 changegroup,
32 cmdutil,
33 commands,
34 error,
35 exchange,
36 hg,
37 lock as lockmod,
38 mdiff,
39 merge,
40 node as nodemod,
41 patch,
42 phases,
43 repair,
44 scmutil,
45 templatefilters,
46 util,
47 )
26 48 from mercurial.i18n import _
27 from mercurial.node import nullid, nullrev, bin, hex
28 from mercurial import changegroup, cmdutil, scmutil, phases, commands
29 from mercurial import error, hg, mdiff, merge, patch, repair, util
30 from mercurial import templatefilters, exchange, bundlerepo, bundle2
31 from mercurial import lock as lockmod
32 from hgext import rebase
33 import errno
49
50 from . import (
51 rebase,
52 )
34 53
35 54 cmdtable = {}
36 55 command = cmdutil.command(cmdtable)
@@ -146,15 +165,15 b' class shelvedstate(object):'
146 165 name = fp.readline().strip()
147 166 wctx = fp.readline().strip()
148 167 pendingctx = fp.readline().strip()
149 parents = [bin(h) for h in fp.readline().split()]
150 stripnodes = [bin(h) for h in fp.readline().split()]
168 parents = [nodemod.bin(h) for h in fp.readline().split()]
169 stripnodes = [nodemod.bin(h) for h in fp.readline().split()]
151 170 finally:
152 171 fp.close()
153 172
154 173 obj = cls()
155 174 obj.name = name
156 obj.wctx = repo[bin(wctx)]
157 obj.pendingctx = repo[bin(pendingctx)]
175 obj.wctx = repo[nodemod.bin(wctx)]
176 obj.pendingctx = repo[nodemod.bin(pendingctx)]
158 177 obj.parents = parents
159 178 obj.stripnodes = stripnodes
160 179
@@ -165,10 +184,12 b' class shelvedstate(object):'
165 184 fp = repo.vfs(cls._filename, 'wb')
166 185 fp.write('%i\n' % cls._version)
167 186 fp.write('%s\n' % name)
168 fp.write('%s\n' % hex(originalwctx.node()))
169 fp.write('%s\n' % hex(pendingctx.node()))
170 fp.write('%s\n' % ' '.join([hex(p) for p in repo.dirstate.parents()]))
171 fp.write('%s\n' % ' '.join([hex(n) for n in stripnodes]))
187 fp.write('%s\n' % nodemod.hex(originalwctx.node()))
188 fp.write('%s\n' % nodemod.hex(pendingctx.node()))
189 fp.write('%s\n' %
190 ' '.join([nodemod.hex(p) for p in repo.dirstate.parents()]))
191 fp.write('%s\n' %
192 ' '.join([nodemod.hex(n) for n in stripnodes]))
172 193 fp.close()
173 194
174 195 @classmethod
@@ -233,7 +254,7 b' def _docreatecmd(ui, repo, pats, opts):'
233 254 """return all mutable ancestors for ctx (included)
234 255
235 256 Much faster than the revset ancestors(ctx) & draft()"""
236 seen = set([nullrev])
257 seen = set([nodemod.nullrev])
237 258 visit = collections.deque()
238 259 visit.append(ctx)
239 260 while visit:
@@ -264,7 +285,7 b' def _docreatecmd(ui, repo, pats, opts):'
264 285 for i in xrange(1, 100):
265 286 yield '%s-%02d' % (label, i)
266 287
267 if parent.node() != nullid:
288 if parent.node() != nodemod.nullid:
268 289 desc = "changes to: %s" % parent.description().split('\n', 1)[0]
269 290 else:
270 291 desc = '(changes in empty repository)'
@@ -62,7 +62,6 b''
62 62 hgext/relink.py not using absolute_import
63 63 hgext/schemes.py not using absolute_import
64 64 hgext/share.py not using absolute_import
65 hgext/shelve.py not using absolute_import
66 65 hgext/transplant.py not using absolute_import
67 66 hgext/win32mbcs.py not using absolute_import
68 67 hgext/win32text.py not using absolute_import
General Comments 0
You need to be logged in to leave comments. Login now