comparison tests/test-issue1802.t @ 15337:cf5f9df6406b stable

windows: recompute flags when committing a merge (issue1802) Before this patch, Windows always did the wrong thing with exec bits when committing a merge: consult the flags in first parent. Now we manually recompute the result of merging flags at commit time, which almost always does the right thing (except when there are conflicts between symlink and exec flags). To do this, we: - pull flag synthesis out into its own function - delay building this function unless it's needed - add a merge case that compares flags in local and other against the ancestor This has been tested in multiple ways on Linux: - running the whole test suite with both old and new code in place, checking for differences in each flags() result - running the whole test suite while comparing real on-disk flags against synthetic ones for merges - test-issue1802 (from Martin Geisler) which disables exec bit checking on Unix
author Matt Mackall <mpm@selenic.com>
date Sat, 22 Oct 2011 16:12:33 -0500
parents
children db0340f4b507
comparison
equal deleted inserted replaced
15336:83debcd7064b 15337:cf5f9df6406b
1 Create extension that can disable exec checks:
2
3 $ cat > noexec.py <<EOF
4 > from mercurial import extensions, util
5 > def setflags(orig, f, l, x):
6 > pass
7 > def checkexec(orig, path):
8 > return False
9 > def extsetup(ui):
10 > extensions.wrapfunction(util, 'setflags', setflags)
11 > extensions.wrapfunction(util, 'checkexec', checkexec)
12 > EOF
13
14 $ hg init unix-repo
15 $ cd unix-repo
16 $ touch a
17 $ hg add a
18 $ hg commit -m 'unix: add a'
19 $ hg clone . ../win-repo
20 updating to branch default
21 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
22 $ chmod +x a
23 $ hg commit -m 'unix: chmod a'
24 $ hg manifest -v
25 755 * a
26
27 $ cd ../win-repo
28
29 $ touch b
30 $ hg add b
31 $ hg commit -m 'win: add b'
32
33 $ hg manifest -v
34 644 a
35 644 b
36
37 $ hg pull
38 pulling from $TESTTMP/unix-repo
39 searching for changes
40 adding changesets
41 adding manifests
42 adding file changes
43 added 1 changesets with 0 changes to 0 files (+1 heads)
44 (run 'hg heads' to see heads, 'hg merge' to merge)
45
46 $ hg manifest -v -r tip
47 755 * a
48
49 Simulate a Windows merge:
50
51 $ hg --config extensions.n=$TESTTMP/noexec.py merge --debug
52 searching for copies back to rev 1
53 unmatched files in local:
54 b
55 resolving manifests
56 overwrite None partial False
57 ancestor a03b0deabf2b local d6fa54f68ae1+ remote 2d8bcf2dda39
58 a: update permissions -> e
59 updating: a 1/1 files (100.00%)
60 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
61 (branch merge, don't forget to commit)
62
63 Simulate a Windows commit:
64
65 $ hg --config extensions.n=$TESTTMP/noexec.py commit -m 'win: merge'
66
67 $ hg manifest -v
68 755 * a
69 644 b