Kiln » Kiln Extensions
Clone URL:  
test-rebase.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
#!/usr/bin/python # # Test rebasing # import os import common hgt = common.BfilesTester() hgt.updaterc() hgt.announce('setup') os.mkdir('repo1') os.chdir('repo1') hgt.hg(['init']) hgt.writefile('n1', 'n1') hgt.hg(['add'], stdout='adding n1\n') hgt.hg(['commit', '-m', 'add n1 in repo1']) hgt.writefile('b1', 'b1') hgt.hg(['add', '--bf', 'b1']) hgt.hg(['commit', '-m', 'add bfile b1 in repo1']) os.chdir('..') hgt.hg(['clone', 'repo1', 'repo2'], stdout='''updating to branch default 2 files updated, 0 files merged, 0 files removed, 0 files unresolved getting changed bfiles 1 big files updated, 0 removed ''') os.chdir('repo1') hgt.writefile('b1', 'b11') hgt.hg(['commit', '-m', 'modify bfile b1 in repo1']) os.chdir('../repo2') hgt.writefile('n1', 'n11') hgt.hg(['commit', '-m', 'modify n1 in repo2']) hgt.hg(['pull', '--rebase'], stdout='''pulling from $HGTMP/test-rebase.py/repo1 searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files (+1 heads) getting changed bfiles 1 big files updated, 0 removed saved backup bundle to $HGTMP/test-rebase.py/repo2/.hg/strip-backup/f525225f596a-backup.hg nothing to rebase ''') hgt.hg(['out', '--bf'], stdout='''comparing with $HGTMP/test-rebase.py/repo1 searching for changes changeset: 3:05e3d87e7926 tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: modify n1 in repo2 searching for changes kbfiles to upload: ''') hgt.writefile('n1', 'n111') hgt.hg(['commit', '-m', 'modify n1']) hgt.hg(['out', '--bf'], stdout='''comparing with $HGTMP/test-rebase.py/repo1 searching for changes changeset: 3:05e3d87e7926 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: modify n1 in repo2 changeset: 4:930afbf48fd0 tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: modify n1 searching for changes kbfiles to upload: ''') hgt.hg(['update', '--clean'], stdout='''0 files updated, 0 files merged, 0 files removed, 0 files unresolved getting changed bfiles 0 big files updated, 0 removed ''') hgt.asserttrue(hgt.readfile('b1') == 'b11', "file contents don't match") # Now do the exact same thing with the rebase command instead of pull --rebase os.chdir('..') os.mkdir('repo3') os.chdir('repo3') hgt.hg(['init']) hgt.writefile('n1', 'n1') hgt.hg(['add'], stdout='adding n1\n') hgt.hg(['commit', '-m', 'add n1 in repo3']) hgt.writefile('b1', 'b1') hgt.hg(['add', '--bf', 'b1']) hgt.hg(['commit', '-m', 'add bfile b1 in repo3']) os.chdir('..') hgt.hg(['clone', 'repo3', 'repo4'], stdout='''updating to branch default 2 files updated, 0 files merged, 0 files removed, 0 files unresolved getting changed bfiles 1 big files updated, 0 removed ''') os.chdir('repo3') hgt.writefile('b1', 'b11') hgt.hg(['commit', '-m', 'modify bfile b1 in repo3']) os.chdir('../repo4') hgt.writefile('n1', 'n11') hgt.hg(['commit', '-m', 'modify n1 in repo4']) hgt.hg(['pull'], stdout='''pulling from $HGTMP/test-rebase.py/repo3 searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files (+1 heads) (run \'hg heads\' to see heads, \'hg merge\' to merge) ''') hgt.hg(['rebase'], stdout='''getting changed bfiles 1 big files updated, 0 removed saved backup bundle to $HGTMP/test-rebase.py/repo4/.hg/strip-backup/f2a8d31d0111-backup.hg ''') hgt.hg(['out', '--bf'], stdout='''comparing with $HGTMP/test-rebase.py/repo3 searching for changes changeset: 3:417329feeb39 tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: modify n1 in repo4 searching for changes kbfiles to upload: ''') hgt.writefile('n1', 'n111') hgt.hg(['commit', '-m', 'modify n1']) hgt.hg(['out', '--bf'], stdout='''comparing with $HGTMP/test-rebase.py/repo3 searching for changes changeset: 3:417329feeb39 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: modify n1 in repo4 changeset: 4:8cdec458685b tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: modify n1 searching for changes kbfiles to upload: ''') hgt.hg(['update', '--clean'], stdout='''0 files updated, 0 files merged, 0 files removed, 0 files unresolved getting changed bfiles 0 big files updated, 0 removed ''') hgt.asserttrue(hgt.readfile('b1') == 'b11', "file contents don't match")