##// END OF EJS Templates
graft: use state.cmdstate() to check whether graftstate exists...
Pulkit Goyal -
r38164:58b08f4c default
parent child Browse files
Show More
@@ -54,6 +54,7 b' from . import ('
54 rewriteutil,
54 rewriteutil,
55 scmutil,
55 scmutil,
56 server,
56 server,
57 state as statemod,
57 streamclone,
58 streamclone,
58 tags as tagsmod,
59 tags as tagsmod,
59 templatekw,
60 templatekw,
@@ -2216,17 +2217,16 b' def _dograft(ui, repo, *revs, **opts):'
2216 **pycompat.strkwargs(opts))
2217 **pycompat.strkwargs(opts))
2217
2218
2218 cont = False
2219 cont = False
2220 graftstate = statemod.cmdstate(repo, 'graftstate')
2219 if opts.get('continue'):
2221 if opts.get('continue'):
2220 cont = True
2222 cont = True
2221 if revs:
2223 if revs:
2222 raise error.Abort(_("can't specify --continue and revisions"))
2224 raise error.Abort(_("can't specify --continue and revisions"))
2223 # read in unfinished revisions
2225 # read in unfinished revisions
2224 try:
2226 if graftstate.exists():
2225 nodes = _readgraftstate(repo)['nodes']
2227 nodes = _readgraftstate(repo)['nodes']
2226 revs = [repo[node].rev() for node in nodes]
2228 revs = [repo[node].rev() for node in nodes]
2227 except IOError as inst:
2229 else:
2228 if inst.errno != errno.ENOENT:
2229 raise
2230 cmdutil.wrongtooltocontinue(repo, _('graft'))
2230 cmdutil.wrongtooltocontinue(repo, _('graft'))
2231 else:
2231 else:
2232 if not revs:
2232 if not revs:
General Comments 0
You need to be logged in to leave comments. Login now