Patchwork [STABLE] test-status: add test for removed-and-untracked state (BC by 65cdc6bab91e)

login
register
mail settings
Submitter Yuya Nishihara
Date July 24, 2014, 3:03 p.m.
Message ID <194ceafd97c458032262.1406214197@mimosa>
Download mbox | patch
Permalink /patch/5195/
State Accepted
Headers show

Comments

Yuya Nishihara - July 24, 2014, 3:03 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1406212765 -32400
#      Thu Jul 24 23:39:25 2014 +0900
# Branch stable
# Node ID 194ceafd97c4580322625a551c93a54646be735c
# Parent  54ff2789d75e0662a536b3da61ca25c07436966b
test-status: add test for removed-and-untracked state (BC by 65cdc6bab91e)

In Mercurial 3.0, "hg status" can list the same file twice if it was removed
but still exists in working directory, i.e. removed by "hg forget":

  $ hg status --rev 0 removed
  R removed
  ? removed

But since 65cdc6bab91e, untracked state, "?", is no longer displayed in this
example.

I think the new behavior is correct since a file should have single state, but
if it is a bug, this patch should be dropped.
Matt Mackall - July 25, 2014, 4:12 p.m.
On Fri, 2014-07-25 at 00:03 +0900, Yuya Nishihara wrote:
> # HG changeset patch
> # User Yuya Nishihara <yuya@tcha.org>
> # Date 1406212765 -32400
> #      Thu Jul 24 23:39:25 2014 +0900
> # Branch stable
> # Node ID 194ceafd97c4580322625a551c93a54646be735c
> # Parent  54ff2789d75e0662a536b3da61ca25c07436966b
> test-status: add test for removed-and-untracked state (BC by 65cdc6bab91e)

Huh. Yeah, I'd certainly say the old behavior was a bug. Queued for
stable, thanks.

Patch

diff --git a/tests/test-status.t b/tests/test-status.t
--- a/tests/test-status.t
+++ b/tests/test-status.t
@@ -280,6 +280,13 @@  hg status -A --change 1 and revset:
   R removed
   C deleted
 
+status of removed but existing in working directory.  "? removed" should
+not be included:
+
+  $ touch removed
+  $ hg status --rev 0 removed
+  R removed
+
   $ cd ..
 
 hg status of binary file starting with '\1\n', a separator for metadata: