# HG changeset patch # User Nicolas Dumazet # Date 2010-08-30 05:06:18 # Node ID a40372c1c7312c25dee1ae3ac999c64155c29598 # Parent f518580093289e470f8e97153e6fa235de804b7a tests: unify test-resolve diff --git a/tests/test-resolve.out b/tests/test-resolve.out deleted file mode 100644 --- a/tests/test-resolve.out +++ /dev/null @@ -1,9 +0,0 @@ -adding file -% create a second head -1 files updated, 0 files merged, 0 files removed, 0 files unresolved -created new head -% failing merge -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 -% resolve -l, should be empty -% resolve -l, should be empty diff --git a/tests/test-resolve b/tests/test-resolve.t old mode 100755 new mode 100644 rename from tests/test-resolve rename to tests/test-resolve.t --- a/tests/test-resolve +++ b/tests/test-resolve.t @@ -1,33 +1,43 @@ -#!/bin/sh +test that a commit clears the merge state. -# test that a commit clears the merge state. + $ hg init repo + $ cd repo + + $ echo foo > file + $ hg commit -Am 'add file' + adding file -hg init repo -cd repo + $ echo bar >> file + $ hg commit -Am 'append bar' + + +create a second head -echo foo > file -hg commit -Am 'add file' - -echo bar >> file -hg commit -Am 'append bar' + $ 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 -echo % create a second head -hg up -C 0 -echo baz >> file -hg commit -Am 'append baz' +failing merge -echo % failing merge -HGMERGE=internal:fail hg merge + $ HGMERGE=internal:fail hg merge + 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 + + $ echo resolved > file + $ hg resolve -m file + $ hg commit -m 'resolved' -echo resolved > file -hg resolve -m file -hg commit -m 'resolved' +resolve -l, should be empty + + $ hg resolve -l + +test crashed merge with empty mergestate -echo % resolve -l, should be empty -hg resolve -l + $ mkdir .hg/merge + $ touch .hg/merge/state -# test crashed merge with empty mergestate -mkdir .hg/merge -touch .hg/merge/state -echo % resolve -l, should be empty -hg resolve -l +resolve -l, should be empty + + $ hg resolve -l