view tests/test-resolve.t @ 22080:37f46575d9c2

phase: attach phase to the transaction instead of the lock The phase cache file is no longer written on lock release, it is now handled by the transaction (as changesets and obsolescence markers are). (Hooray) As we stop relying on the lock to write phase, repos with no existing phase information will need to wait for a phase move or a strip to happen in order to get the first write in the `phaseroots` file. This explain the change in test-inherit-mode.t. This should not have any side effects but in very obscure cases where people interact with pre-2.1 and post-2.1 versions of Mercurial on the same repo while having MQ patches applied but the MQ extension disabled from time to time. A case unlikely enough to not be worth preserving the old behavior with awful hacks.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Thu, 07 Aug 2014 14:11:36 -0700
parents b081decd9062
children dfad19274d85
line wrap: on
line source

test that a commit clears the merge state.

  $ hg init repo
  $ cd repo

  $ echo foo > file
  $ hg commit -Am 'add file'
  adding file

  $ echo bar >> file
  $ hg commit -Am 'append bar'


create a second head

  $ hg up -C 0
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
  $ echo baz >> file
  $ hg commit -Am 'append baz'
  created new head

failing merge

  $ hg merge --tool=internal:fail
  0 files updated, 0 files merged, 0 files removed, 1 files unresolved
  use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
  [1]

resolve -l should contain an unresolved entry

  $ hg resolve -l
  U file

resolving an unknown path emits a warning
  $ hg resolve -m does-not-exist
  arguments do not match paths that need resolving

resolve the failure

  $ echo resolved > file
  $ hg resolve -m file
  (no more unresolved files)
  $ hg commit -m 'resolved'

resolve -l should be empty

  $ hg resolve -l

resolve -m should abort since no merge in progress
  $ hg resolve -m
  abort: resolve command not applicable when not merging
  [255]

test crashed merge with empty mergestate

  $ mkdir .hg/merge
  $ touch .hg/merge/state

resolve -l, should be empty

  $ hg resolve -l

  $ cd ..