Mercurial > hg
annotate tests/test-exchange-obsmarkers-case-B7.t @ 38483:3efadf2317c7
windows: add a method to convert Unix style command lines to Windows style
This started as a copy/paste of `os.path.expandvars()`, but limited to a given
dictionary of variables, converting `foo = foo + bar` to `foo += bar`, and
adding 'b' string prefixes. Then code was added to make sure that a value being
substituted in wouldn't itself be expanded by cmd.exe. But that left
inconsistent results between `$var1` and `%var1%` when its value was '%foo%'-
since neither were touched, `$var1` wouldn't expand but `%var1%` would. So
instead, this just converts the Unix style to Windows style (if the variable
exists, because Windows will leave `%missing%` as-is), and lets cmd.exe do its
thing.
I then dropped the %% -> % conversion (because Windows doesn't do this), and
added the ability to escape the '$' with '\'. The escape character is dropped,
for consistency with shell handling.
After everything seemed stable and working, running the whole test suite flagged
a problem near the end of test-bookmarks.t:1069. The problem is cmd.exe won't
pass empty variables to its child, so defined but empty variables are now
skipped. I can't think of anything better, and it seems like a pre-existing
violation of the documentation, which calls out that HG_OLDNODE is empty on
bookmark creation.
Future additions could potentially be replacing strong quotes with double quotes
(cmd.exe doesn't know what to do with the former), escaping a double quote, and
some tilde expansion via os.path.expanduser(). I've got some doubts about
replacing the strong quotes in case sh.exe is run, but it seems like the right
thing to do the vast majority of the time. The original form of this was
discussed about a year ago[1].
[1] https://www.mercurial-scm.org/pipermail/mercurial-devel/2017-July/100735.html
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Sun, 24 Jun 2018 01:13:09 -0400 |
parents | 2bf73e351eb1 |
children |
rev | line source |
---|---|
31919
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
1 ============================================ |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
2 Testing obsolescence markers push: Cases B.7 |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
3 ============================================ |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
4 |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
5 Mercurial pushes obsolescences markers relevant to the "pushed-set", the set of |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
6 all changesets that requested to be "in sync" after the push (even if they are |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
7 already on both side). |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
8 |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
9 This test belongs to a series of tests checking such set is properly computed |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
10 and applied. This does not tests "obsmarkers" discovery capabilities. |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
11 |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
12 Category B: pruning case |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
13 TestCase 7: Prune on non-targeted common changeset |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
14 |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
15 B.7 Prune above non-targeted common changeset |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
16 ============================================= |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
17 |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
18 .. (very similar to B1, but the prune changeset is unknown on remote) |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
19 .. |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
20 .. {{{ |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
21 .. ⊗ B |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
22 .. | |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
23 .. ◕ A |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
24 .. | |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
25 .. ● O |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
26 .. }}} |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
27 .. |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
28 .. Marker exist from: |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
29 .. |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
30 .. * B (prune) |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
31 .. |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
32 .. Command runs: |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
33 .. |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
34 .. * hg push -r O |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
35 .. |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
36 .. Expected exclude: |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
37 .. |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
38 .. * B (prune) |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
39 |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
40 Setup |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
41 ----- |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
42 |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
43 $ . $TESTDIR/testlib/exchange-obsmarker-util.sh |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
44 |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
45 Initial |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
46 |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
47 $ setuprepos B.7 |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
48 creating test repo for test case B.7 |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
49 - pulldest |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
50 - main |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
51 - pushdest |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
52 cd into `main` and proceed with env setup |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
53 $ cd main |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
54 $ mkcommit A |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
55 $ hg push -q ../pushdest |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
56 $ hg push -q ../pulldest |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
57 $ mkcommit B |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
58 $ hg prune -qd '0 0' . |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
59 $ hg log -G --hidden |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
60 x f6fbb35d8ac9 (draft): B |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
61 | |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
62 @ f5bc6836db60 (draft): A |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
63 | |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
64 o a9bdc8b26820 (public): O |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
65 |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
66 $ inspect_obsmarkers |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
67 obsstore content |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
68 ================ |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
69 f6fbb35d8ac958bbe70035e4c789c18471cdc0af 0 {f5bc6836db60e308a17ba08bf050154ba9c4fad7} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
70 $ cd .. |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
71 $ cd .. |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
72 |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
73 Actual Test |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
74 ------------------------------------- |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
75 |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
76 $ dotest B.7 O |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
77 ## Running testcase B.7 |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
78 # testing echange of "O" (a9bdc8b26820) |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
79 ## initial state |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
80 # obstore: main |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
81 f6fbb35d8ac958bbe70035e4c789c18471cdc0af 0 {f5bc6836db60e308a17ba08bf050154ba9c4fad7} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
82 # obstore: pushdest |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
83 # obstore: pulldest |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
84 ## pushing "O" from main to pushdest |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
85 pushing to pushdest |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
86 searching for changes |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
87 no changes found |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
88 ## post push state |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
89 # obstore: main |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
90 f6fbb35d8ac958bbe70035e4c789c18471cdc0af 0 {f5bc6836db60e308a17ba08bf050154ba9c4fad7} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
91 # obstore: pushdest |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
92 # obstore: pulldest |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
93 ## pulling "a9bdc8b26820" from main into pulldest |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
94 pulling from main |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
95 no changes found |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
96 ## post pull state |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
97 # obstore: main |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
98 f6fbb35d8ac958bbe70035e4c789c18471cdc0af 0 {f5bc6836db60e308a17ba08bf050154ba9c4fad7} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
99 # obstore: pushdest |
2bf73e351eb1
obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
100 # obstore: pulldest |