view tests/test-commit-unresolved.t @ 18625:2cbd27f4f3c4

dirstate: walk returns None for files that have a symlink in their path Previously dirstate.walk would return a stat object for files in the dmap that have a symlink to a directory in their path. Now it will return None to indicate that they are no longer considered part of the repository. This currently only affects walks that traverse the entire directory tree (ex: hg status) and not walks that only list the contents of the dmap (ex: hg diff). In a situation like this: mkdir foo && touch foo/a && hg commit -Am "a" mv foo bar ln -s bar foo 'hg status' will now show '! foo/a', whereas before it incorrectly considered 'foo/a' to be unchanged. In addition to making 'hg status' report the correct information, this will allow callers to dirstate.walk to not have to detect symlinks themselves, which can be very expensive.
author Durham Goode <durham@fb.com>
date Mon, 04 Feb 2013 14:27:15 -0800
parents f2719b387380
children aa9385f983fa
line wrap: on
line source

  $ echo "[extensions]" >> $HGRCPATH
  $ echo "graphlog=" >> $HGRCPATH

  $ addcommit () {
  >     echo $1 > $1
  >     hg add $1
  >     hg commit -d "${2} 0" -m $1
  > }

  $ commit () {
  >     hg commit -d "${2} 0" -m $1
  > }

  $ hg init a
  $ cd a
  $ addcommit "A" 0
  $ addcommit "B" 1
  $ echo "C" >> A
  $ commit "C" 2

  $ hg update -C 0
  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
  $ echo "D" >> A
  $ commit "D" 3
  created new head

Merging a conflict araises

  $ hg merge
  merging A
  warning: conflicts during merge.
  merging A incomplete! (edit conflicts, then use 'hg resolve --mark')
  1 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]

Correct the conflict without marking the file as resolved

  $ echo "ABCD" > A
  $ hg commit -m "Merged"
  abort: unresolved merge conflicts (see hg help resolve)
  [255]

Mark the conflict as resolved and commit

  $ hg resolve -m A
  $ hg commit -m "Merged"

  $ cd ..