Mercurial > public > mercurial-scm > hg
diff tests/test-commit.t @ 23712:bfce25d25c96
context: override _dirstatestatus in workingcommitctx for correct matching
Before this patch, the result of "status()" on "workingcommitctx" may
incorrectly contain files other than ones to be committed, because
"workingctx._dirstatestatus()" returns the result of
"dirstate.status()" directly.
For correct matching, this patch overrides "_dirstatestatus" in
"workingcommitctx" and makes it return matched files only in
"self._status".
This patch uses empty list for "deleted", "unknown" and "ignored" of
status, because status between "changectx"s also makes them empty.
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Wed, 31 Dec 2014 17:55:43 +0900 |
parents | 1e6fb8db666e |
children | a387b0390082 |
line wrap: on
line diff
--- a/tests/test-commit.t Wed Dec 31 17:55:43 2014 +0900 +++ b/tests/test-commit.t Wed Dec 31 17:55:43 2014 +0900 @@ -434,7 +434,7 @@ > changeset = {desc} > HG: files={files} > HG: - > {splitlines(diff()) % '' + > {splitlines(diff()) % 'HG: {line}\n' > }HG: > HG: files={files}\n > EOF @@ -446,6 +446,11 @@ foo bar HG: files=changed HG: + HG: --- a/changed Thu Jan 01 00:00:00 1970 +0000 + HG: +++ b/changed Thu Jan 01 00:00:00 1970 +0000 + HG: @@ -1,1 +1,2 @@ + HG: changed + HG: +changed HG: HG: files=changed $ hg status -amr @@ -458,6 +463,51 @@ $ hg rollback -q $ cat >> .hg/hgrc <<EOF + > [committemplate] + > changeset = {desc} + > HG: files={files} + > HG: + > {splitlines(diff("changed")) % 'HG: {line}\n' + > }HG: + > HG: files={files} + > HG: + > {splitlines(diff("added")) % 'HG: {line}\n' + > }HG: + > HG: files={files} + > HG: + > {splitlines(diff("removed")) % 'HG: {line}\n' + > }HG: + > HG: files={files}\n + > EOF + $ HGEDITOR=cat hg commit -q -e -m "foo bar" added removed + foo bar + HG: files=added removed + HG: + HG: + HG: files=added removed + HG: + HG: --- /dev/null Thu Jan 01 00:00:00 1970 +0000 + HG: +++ b/added Thu Jan 01 00:00:00 1970 +0000 + HG: @@ -0,0 +1,1 @@ + HG: +added + HG: + HG: files=added removed + HG: + HG: --- a/removed Thu Jan 01 00:00:00 1970 +0000 + HG: +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 + HG: @@ -1,1 +0,0 @@ + HG: -removed + HG: + HG: files=added removed + $ hg status -amr + M changed + $ hg parents --template "M {file_mods}\nA {file_adds}\nR {file_dels}\n" + M + A added + R removed + $ hg rollback -q + + $ cat >> .hg/hgrc <<EOF > # disable customizing for subsequent tests > [committemplate] > changeset =