comparison mercurial/commands.py @ 38151:0dfa27e53c57

graft: use cmdstate.delete() to delete the state file Previous patches start using state.cmdstate() class for statefiles. The class has a function delete() to delete the state file. This patch replaces the existing repo.vfs.unlink() with that delete() function. Differential Revision: https://phab.mercurial-scm.org/D3656
author Pulkit Goyal <7895pulkit@gmail.com>
date Fri, 25 May 2018 16:00:37 +0530
parents 476324a304b2
children 63553c2bef7e
comparison
equal deleted inserted replaced
38150:24e517600b29 38151:0dfa27e53c57
2377 _('note: graft of %d:%s created no changes to commit\n') % 2377 _('note: graft of %d:%s created no changes to commit\n') %
2378 (ctx.rev(), ctx)) 2378 (ctx.rev(), ctx))
2379 2379
2380 # remove state when we complete successfully 2380 # remove state when we complete successfully
2381 if not opts.get('dry_run'): 2381 if not opts.get('dry_run'):
2382 repo.vfs.unlinkpath('graftstate', ignoremissing=True) 2382 graftstate.delete()
2383 2383
2384 return 0 2384 return 0
2385 2385
2386 def _readgraftstate(repo, graftstate): 2386 def _readgraftstate(repo, graftstate):
2387 """read the graft state file and return a dict of the data stored in it""" 2387 """read the graft state file and return a dict of the data stored in it"""