tests/test-up-local-change.out
author maf46@burn.cl.cam.ac.uk
Mon, 04 Jul 2005 12:38:34 -0800
changeset 616 d45d1c90032e
parent 591 eb46971fc57f
child 619 d96c1153b25d
permissions -rw-r--r--
Fix zombie files in merge # HG changeset patch # User maf46@burn.cl.cam.ac.uk # Node ID 57667c9b93a5a743e4629d15a0e6bd76699130c3 # Parent d2994b5298fb20f87dc1d4747635b280db3c0526 Fix zombie files in merge Keir Fraser observed the following: > I made a small test case that illustrates the bug in merging changesets > with 'hg remove's in them: > > 1. Create a repository A containing files foo & bar. > 2. Create clone called B. > 3. A removes file bar, and commits this removal. > 4. B edits file foo, and commits this edit. > > Now, if B: > # hg pull ../A; hg update -m; hg commit > Then bar remains deleted. > > If A: > # hg pull ../B; hg update -m; hg commit > Then bar is resurrected! > > It looks as though, when you merge across a branch, any deletions in > your own branch are forgotten. > ... > Fixing this is a must, as zombie files are a real pain. :-) Keir later patched our local copy of hg as shown below, which fixes the problem. I've also enclosed a test which captures the test Keir outlined... Files deleted on a branch should not automatically reappear in a merge Patch notes: 1. The first chunk does not change behaviour, but cleans up the code to more closely match check of 'force' in the second chunk. I think it makes the code clearer. 2. The second chunk fixes two bugs -- i. If we choose to keep a remotely-changed locally-deleted file, then we need to 'get' that file. If we choose to delete it then no action need be taken (it is already deleted in the working manifest). Without this fix, choosing to delete would get a Python traceback. ii. The test for whether the file was remotely-created is insufficient. It is only true if f is not in the common ancestor. Otherwise the file was deleted locally, and should remain deleted. (this is the most important fix!) Index: hg/tests/test-merge6 ===================================================================
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
331
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
     1
+ mkdir r1
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
     2
+ cd r1
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
     3
+ hg init
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
     4
+ echo a
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
     5
+ hg addremove
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
     6
+ hg commit -t 1 -u test -d '0 0'
485
c5705ab9cebd [PATCH] add clone command
mpm@selenic.com
parents: 396
diff changeset
     7
+ hg clone . ../r2
c5705ab9cebd [PATCH] add clone command
mpm@selenic.com
parents: 396
diff changeset
     8
+ cd ../r2
331
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
     9
+ hg up
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
    10
+ echo abc
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
    11
+ hg diff
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
    12
+ sed 's/\(\(---\|+++\).*\)\t.*/\1/'
396
8f8bb77d560e Show revisions in diffs like CVS, based on a patch from Goffredo Baroncelli.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 388
diff changeset
    13
diff -r c19d34741b0a a
331
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
    14
--- a/a
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
    15
+++ b/a
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
    16
@@ -1,1 +1,1 @@
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
    17
-a
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
    18
+abc
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
    19
+ cd ../r1
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
    20
+ echo b
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
    21
+ echo a2
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
    22
+ hg addremove
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
    23
+ hg commit -t 2 -u test -d '0 0'
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
    24
+ cd ../r2
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
    25
+ hg -q pull ../r1
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
    26
+ hg status
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
    27
C a
591
eb46971fc57f options: kill -d for debug
mpm@selenic.com
parents: 547
diff changeset
    28
+ hg --debug up
331
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
    29
resolving manifests
374
f07d00fcd281 update tests to reflect new short hash length
mpm@selenic.com
parents: 350
diff changeset
    30
 ancestor a0c8bcbbb45c local a0c8bcbbb45c remote 1165e8bd193e
331
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
    31
 a versions differ, resolve
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
    32
remote created b
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
    33
getting b
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
    34
merging a
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
    35
resolving a
374
f07d00fcd281 update tests to reflect new short hash length
mpm@selenic.com
parents: 350
diff changeset
    36
file a: other d730145abbf9 ancestor b789fdd96dc2
591
eb46971fc57f options: kill -d for debug
mpm@selenic.com
parents: 547
diff changeset
    37
+ hg --debug up -m
331
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
    38
resolving manifests
374
f07d00fcd281 update tests to reflect new short hash length
mpm@selenic.com
parents: 350
diff changeset
    39
 ancestor 1165e8bd193e local 1165e8bd193e remote 1165e8bd193e
331
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
    40
+ hg parents
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
    41
changeset:   1:1e71731e6fbb5b35fae293120dea6964371c13c6
388
398737777644 Fixed tests for displaying tags in hg history and hg parents.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 382
diff changeset
    42
tag:         tip
331
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
    43
user:        test
382
37249c522770 test suite: fix timezone problems and port collision problem
mpm@selenic.com
parents: 377
diff changeset
    44
date:        Thu Jan  1 00:00:00 1970
331
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
    45
summary:     2
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
    46
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
    47
+ hg -v history
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
    48
changeset:   1:1e71731e6fbb5b35fae293120dea6964371c13c6
388
398737777644 Fixed tests for displaying tags in hg history and hg parents.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 382
diff changeset
    49
tag:         tip
331
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
    50
manifest:    1:1165e8bd193e17ad7d321d846fcf27ff3f412758
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
    51
user:        test
382
37249c522770 test suite: fix timezone problems and port collision problem
mpm@selenic.com
parents: 377
diff changeset
    52
date:        Thu Jan  1 00:00:00 1970
494
6020bde714e4 Fixed test for previous change of 'hg -v history'.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 490
diff changeset
    53
files:       a b
331
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
    54
description:
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
    55
2
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
    56
546
c8ae964109c1 Add an empty line after description in verbose mode of show_changeset.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 495
diff changeset
    57
331
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
    58
changeset:   0:c19d34741b0a4ced8e4ba74bb834597d5193851e
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
    59
manifest:    0:a0c8bcbbb45c63b90b70ad007bf38961f64f2af0
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
    60
user:        test
382
37249c522770 test suite: fix timezone problems and port collision problem
mpm@selenic.com
parents: 377
diff changeset
    61
date:        Thu Jan  1 00:00:00 1970
494
6020bde714e4 Fixed test for previous change of 'hg -v history'.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 490
diff changeset
    62
files:       a
331
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
    63
description:
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
    64
1
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
    65
546
c8ae964109c1 Add an empty line after description in verbose mode of show_changeset.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 495
diff changeset
    66
331
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
    67
+ hg diff
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
    68
+ sed 's/\(\(---\|+++\).*\)\t.*/\1/'
396
8f8bb77d560e Show revisions in diffs like CVS, based on a patch from Goffredo Baroncelli.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 388
diff changeset
    69
diff -r 1e71731e6fbb a
331
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
    70
--- a/a
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
    71
+++ b/a
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
    72
@@ -1,1 +1,1 @@
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
    73
-a2
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
    74
+abc