diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -54,6 +54,7 @@ rewriteutil, scmutil, server, + state as statemod, streamclone, tags as tagsmod, templatekw, @@ -2174,7 +2175,9 @@ raise error.Abort(_("can't specify --continue and revisions")) # read in unfinished revisions try: - nodes = repo.vfs.read('graftstate').splitlines() + with repo.vfs('graftstate', 'rb') as fp: + stateopts = statemod.oldgraftstate(fp) + nodes = stateopts['nodes'] revs = [repo[node].rev() for node in nodes] except IOError as inst: if inst.errno != errno.ENOENT: diff --git a/mercurial/state.py b/mercurial/state.py --- a/mercurial/state.py +++ b/mercurial/state.py @@ -113,3 +113,8 @@ oldstatefilefns[path] = func return func return dec + +@readoldstatefile('graftstate') +def oldgraftstate(fp): + nodes = fp.read().splitlines() + return {'nodes': nodes}