# HG changeset patch # User Pulkit Goyal <7895pulkit@gmail.com> # Date 2018-05-25 10:30:37 # Node ID 0dfa27e53c57638effd098ecdcf96be685e13af9 # Parent 24e517600b2986a3d5855456b3cdf0830ea0a79e 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 diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -2379,7 +2379,7 @@ def _dograft(ui, repo, *revs, **opts): # remove state when we complete successfully if not opts.get('dry_run'): - repo.vfs.unlinkpath('graftstate', ignoremissing=True) + graftstate.delete() return 0