##// END OF EJS Templates
tests: add tests for new pre-push logic (issue736)...
Sune Foldager -
r8565:268d16b2 default
parent child Browse files
Show More
@@ -59,4 +59,68 b' hg init ../e'
59 hg push -r 0 ../e ; echo $?
59 hg push -r 0 ../e ; echo $?
60 hg push -r 1 ../e ; echo $?
60 hg push -r 1 ../e ; echo $?
61
61
62 cd ..
63
64 # issue 736
65 echo % issue 736
66 hg init f
67 cd f
68 hg -q branch a
69 echo 0 > foo
70 hg -q ci -d "1000000 0" -Am 0
71 echo 1 > foo
72 hg -q ci -d "1000000 0" -m 1
73 hg -q up 0
74 echo 2 > foo
75 hg -q ci -d "1000000 0" -m 2
76 hg -q up 0
77 hg -q branch b
78 echo 3 > foo
79 hg -q ci -d "1000000 0" -m 3
80 cd ..
81
82 hg -q clone f g
83 cd g
84
85 echo % push on existing branch and new branch
86 hg -q up 1
87 echo 4 > foo
88 hg -q ci -d "1000000 0" -m 4
89 hg -q up 0
90 echo 5 > foo
91 hg -q branch c
92 hg -q ci -d "1000000 0" -m 5
93 hg push -r 4 -r 5 ../f; echo $?
94
95 echo % fail on multiple head push
96 hg -q up 1
97 echo 6 > foo
98 hg -q ci -d "1000000 0" -m 6
99 hg push -r 4 -r 6 ../f; echo $?
100
101 echo % push replacement head on existing branches
102 hg -q up 3
103 echo 7 > foo
104 hg -q ci -d "1000000 0" -m 7
105 hg push -r 6 -r 7 ../f; echo $?
106
107 echo % merge of branch a to other branch b followed by unrelated push on branch a
108 hg -q up 6
109 HGMERGE=true hg -q merge 7
110 hg -q ci -d "1000000 0" -m 8
111 hg -q up 7
112 echo 9 > foo
113 hg -q ci -d "1000000 0" -m 9
114 hg push -r 8 ../f; echo $?
115 hg push -r 9 ../f; echo $?
116
117 echo % cheating the counting algorithm
118 hg -q up 8
119 HGMERGE=true hg -q merge 2
120 hg -q ci -d "1000000 0" -m 10
121 hg -q up 1
122 echo 11 > foo
123 hg -q ci -d "1000000 0" -m 11
124 hg push -r 10 -r 11 ../f; echo $?
125
62 exit 0
126 exit 0
@@ -80,3 +80,47 b' adding manifests'
80 adding file changes
80 adding file changes
81 added 1 changesets with 1 changes to 1 files
81 added 1 changesets with 1 changes to 1 files
82 0
82 0
83 % issue 736
84 % push on existing branch and new branch
85 pushing to ../f
86 searching for changes
87 abort: push creates new remote branch 'c'!
88 (did you forget to merge? use push -f to force)
89 1
90 % fail on multiple head push
91 pushing to ../f
92 searching for changes
93 abort: push creates new remote heads!
94 (did you forget to merge? use push -f to force)
95 1
96 % push replacement head on existing branches
97 pushing to ../f
98 searching for changes
99 adding changesets
100 adding manifests
101 adding file changes
102 added 2 changesets with 2 changes to 1 files
103 0
104 % merge of branch a to other branch b followed by unrelated push on branch a
105 pushing to ../f
106 searching for changes
107 adding changesets
108 adding manifests
109 adding file changes
110 added 1 changesets with 1 changes to 1 files (-1 heads)
111 0
112 pushing to ../f
113 searching for changes
114 adding changesets
115 adding manifests
116 adding file changes
117 added 1 changesets with 1 changes to 1 files (+1 heads)
118 0
119 % cheating the counting algorithm
120 pushing to ../f
121 searching for changes
122 adding changesets
123 adding manifests
124 adding file changes
125 added 2 changesets with 2 changes to 1 files
126 0
General Comments 0
You need to be logged in to leave comments. Login now