comparison hgext/fix.py @ 44856:b7808443ed6a

mergestate: split out merge state handling code from main merge module There's already some pretty reasonable encapsulation here, but I want to make the mergestate storage a property of the context so memctx instances can do a reasonable thing. This is the first step in a reshuffle to make that easier. Differential Revision: https://phab.mercurial-scm.org/D8550
author Augie Fackler <augie@google.com>
date Mon, 18 May 2020 14:59:59 -0400
parents a6ef1e8e2f6d
children 54009f8c3e25
comparison
equal deleted inserted replaced
44855:1d2d353e5c4a 44856:b7808443ed6a
142 copies, 142 copies,
143 error, 143 error,
144 match as matchmod, 144 match as matchmod,
145 mdiff, 145 mdiff,
146 merge, 146 merge,
147 mergestate as mergestatemod,
147 pycompat, 148 pycompat,
148 registrar, 149 registrar,
149 rewriteutil, 150 rewriteutil,
150 scmutil, 151 scmutil,
151 util, 152 util,
424 checkfixablectx(ui, repo, repo[rev]) 425 checkfixablectx(ui, repo, repo[rev])
425 # Allow fixing only wdir() even if there's an unfinished operation 426 # Allow fixing only wdir() even if there's an unfinished operation
426 if not (len(revs) == 1 and wdirrev in revs): 427 if not (len(revs) == 1 and wdirrev in revs):
427 cmdutil.checkunfinished(repo) 428 cmdutil.checkunfinished(repo)
428 rewriteutil.precheck(repo, revs, b'fix') 429 rewriteutil.precheck(repo, revs, b'fix')
429 if wdirrev in revs and list(merge.mergestate.read(repo).unresolved()): 430 if wdirrev in revs and list(
431 mergestatemod.mergestate.read(repo).unresolved()
432 ):
430 raise error.Abort(b'unresolved conflicts', hint=b"use 'hg resolve'") 433 raise error.Abort(b'unresolved conflicts', hint=b"use 'hg resolve'")
431 if not revs: 434 if not revs:
432 raise error.Abort( 435 raise error.Abort(
433 b'no changesets specified', hint=b'use --rev or --working-dir' 436 b'no changesets specified', hint=b'use --rev or --working-dir'
434 ) 437 )