annotate tests/test-exchange-D1.t @ 996:b98dd5d3065c

fold: overhaul handling of revisions with --rev (BC) The fold command parsed the revision arguments in a very peculiar and idiosyncratic fashion: if revisions were passed without a --rev argument, then they would all be extended to ".", but if they were passed with --rev, then no extension would happen. Passing revisions both with and without --rev would abort. This is inconsistent with the way all other hg commands parse revision arguments. We have several examples of command where several revisions are passed, and the --rev option is optional for specifying those revisions (update, strip, export). This patch alters the way in which fold parses its revision arguments. No distinction is made between revisions passed with or without the --rev argument. Regardless if a single or multiple revision is specified, all will be folded together into the parent of the working directory. If the --exact argument is passed, then the parent of the working directory is ignored and the specified revisions must be a single contiguous line. The docstring and tests are modified accordingly.
author Jordi Gutiérrez Hermoso <jordigh@octave.org>
date Mon, 30 Jun 2014 13:29:49 -0400
parents b286f77d680c
children bddee73b361e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
848
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
1
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
2 Initial setup
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
3
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
4 $ . $TESTDIR/_exc-util.sh
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
5
984
b286f77d680c tests: fix grammar, spelling, punctuation in comments
Greg Ward <greg@gerg.ca>
parents: 957
diff changeset
6 === D.1 Pruned changeset based on missing precursor of something not present ===
848
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
7
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
8 .. {{{
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
9 .. B ⊗
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
10 .. |
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
11 .. A ◌⇠◔ A'
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
12 .. |/
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
13 .. ● O
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
14 .. }}}
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
15 ..
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
16 .. Marker exist from:
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
17 ..
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
18 .. * A' succeed to A
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
19 .. * B (prune)
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
20 ..
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
21 .. Command run:
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
22 ..
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
23 .. * hg push -r A'
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
24 .. * hg push
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
25 ..
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
26 .. Expected exchange:
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
27 ..
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
28 .. * `A ø⇠o A'`
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
29 .. * B (prune)
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
30
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
31 $ setuprepos D.1
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
32 creating test repo for test case D.1
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
33 - pulldest
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
34 - main
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
35 - pushdest
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
36 cd into `main` and proceed with env setup
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
37 $ cd main
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
38 $ mkcommit A0
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
39 $ mkcommit B
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
40 $ hg up -q 0
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
41 $ mkcommit A1
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
42 created new head
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
43 $ hg debugobsolete `getid 'desc(A0)'` `getid 'desc(A1)'`
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
44 $ hg prune -d '0 0' 'desc(B)'
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
45 1 changesets pruned
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
46 $ hg strip --hidden -q 'desc(A0)'
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
47 $ hg log -G --hidden
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
48 @ e5ea8f9c7314 (draft): A1
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
49 |
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
50 o a9bdc8b26820 (public): O
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
51
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
52 $ hg debugobsolete
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
53 28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 {'date': '', 'user': 'test'}
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
54 06055a7959d4128e6e3bccfd01482e83a2db8a3a 0 {'date': '0 0', 'p1': '28b51eb45704506b5c603decd6bf7ac5e0f6a52f', 'user': 'test'}
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
55 $ cd ..
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
56 $ cd ..
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
57
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
58 Actual Test
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
59 -------------------------------------
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
60
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
61 $ dotest D.1 A1
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
62 ## Running testcase D.1
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
63 # testing echange of "A1" (e5ea8f9c7314)
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
64 ## initial state
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
65 # obstore: main
905
b177fde040dd exchange: use fixed order for obstore content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 848
diff changeset
66 06055a7959d4128e6e3bccfd01482e83a2db8a3a 0 {'date': '0 0', 'p1': '28b51eb45704506b5c603decd6bf7ac5e0f6a52f', 'user': 'test'}
848
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
67 28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 {'date': '', 'user': 'test'}
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
68 # obstore: pushdest
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
69 # obstore: pulldest
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
70 ## pushing "A1" from main to pushdest
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
71 pushing to pushdest
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
72 searching for changes
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
73 adding changesets
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
74 adding manifests
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
75 adding file changes
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
76 added 1 changesets with 1 changes to 1 files
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
77 OBSEXC: computing relevant nodes
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
78 OBSEXC: computing markers relevant to 2 nodes
957
2cde59f3cb5d evolve: add a push pass using bundle2
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 956
diff changeset
79 OBSEXC: pushing 2 markers (150 bytes)
848
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
80 OBSEXC: DONE
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
81 ## post push state
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
82 # obstore: main
905
b177fde040dd exchange: use fixed order for obstore content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 848
diff changeset
83 06055a7959d4128e6e3bccfd01482e83a2db8a3a 0 {'date': '0 0', 'p1': '28b51eb45704506b5c603decd6bf7ac5e0f6a52f', 'user': 'test'}
848
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
84 28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 {'date': '', 'user': 'test'}
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
85 # obstore: pushdest
905
b177fde040dd exchange: use fixed order for obstore content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 848
diff changeset
86 06055a7959d4128e6e3bccfd01482e83a2db8a3a 0 {'date': '0 0', 'p1': '28b51eb45704506b5c603decd6bf7ac5e0f6a52f', 'user': 'test'}
848
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
87 28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 {'date': '', 'user': 'test'}
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
88 # obstore: pulldest
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
89 ## pulling "e5ea8f9c7314" from main into pulldest
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
90 pulling from main
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
91 searching for changes
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
92 adding changesets
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
93 adding manifests
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
94 adding file changes
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
95 added 1 changesets with 1 changes to 1 files
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
96 OBSEXC: pull obsolescence markers
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
97 OBSEXC: merging obsolescence markers (150 bytes)
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
98 OBSEXC: 2 markers added
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
99 OBSEXC: DONE
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
100 (run 'hg update' to get a working copy)
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
101 ## post pull state
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
102 # obstore: main
905
b177fde040dd exchange: use fixed order for obstore content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 848
diff changeset
103 06055a7959d4128e6e3bccfd01482e83a2db8a3a 0 {'date': '0 0', 'p1': '28b51eb45704506b5c603decd6bf7ac5e0f6a52f', 'user': 'test'}
848
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
104 28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 {'date': '', 'user': 'test'}
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
105 # obstore: pushdest
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
106 06055a7959d4128e6e3bccfd01482e83a2db8a3a 0 {'date': '0 0', 'p1': '28b51eb45704506b5c603decd6bf7ac5e0f6a52f', 'user': 'test'}
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
107 28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 {'date': '', 'user': 'test'}
905
b177fde040dd exchange: use fixed order for obstore content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 848
diff changeset
108 # obstore: pulldest
848
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
109 06055a7959d4128e6e3bccfd01482e83a2db8a3a 0 {'date': '0 0', 'p1': '28b51eb45704506b5c603decd6bf7ac5e0f6a52f', 'user': 'test'}
905
b177fde040dd exchange: use fixed order for obstore content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 848
diff changeset
110 28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 {'date': '', 'user': 'test'}
848
001f8508910a exchange: add test case for D.1
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
111