Show More
@@ -2797,8 +2797,16 b' def reposetup(ui, repo):' | |||||
2797 | editor, extra) |
|
2797 | editor, extra) | |
2798 |
|
2798 | |||
2799 | def push(self, remote, force=False, revs=None, newbranch=False): |
|
2799 | def push(self, remote, force=False, revs=None, newbranch=False): | |
2800 |
if self.mq.applied and not force |
|
2800 | if self.mq.applied and not force: | |
2801 | raise util.Abort(_('source has mq patches applied')) |
|
2801 | haspatches = True | |
|
2802 | if revs: | |||
|
2803 | # Assume applied patches have no non-patch descendants | |||
|
2804 | # and are not on remote already. If they appear in the | |||
|
2805 | # set of resolved 'revs', bail out. | |||
|
2806 | applied = set(e.node for e in self.mq.applied) | |||
|
2807 | haspatches = bool([n for n in revs if n in applied]) | |||
|
2808 | if haspatches: | |||
|
2809 | raise util.Abort(_('source has mq patches applied')) | |||
2802 | return super(mqrepo, self).push(remote, force, revs, newbranch) |
|
2810 | return super(mqrepo, self).push(remote, force, revs, newbranch) | |
2803 |
|
2811 | |||
2804 | def _findtags(self): |
|
2812 | def _findtags(self): |
@@ -110,3 +110,67 b' qpush warning branchheads' | |||||
110 | $ hg qpush |
|
110 | $ hg qpush | |
111 | applying qp |
|
111 | applying qp | |
112 | now at: qp |
|
112 | now at: qp | |
|
113 | ||||
|
114 | Testing applied patches, push and --force | |||
|
115 | ||||
|
116 | $ cd .. | |||
|
117 | $ hg init forcepush | |||
|
118 | $ cd forcepush | |||
|
119 | $ echo a > a | |||
|
120 | $ hg ci -Am adda | |||
|
121 | adding a | |||
|
122 | $ echo a >> a | |||
|
123 | $ hg ci -m changea | |||
|
124 | $ hg up 0 | |||
|
125 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
126 | $ hg branch branch | |||
|
127 | marked working directory as branch branch | |||
|
128 | $ echo b > b | |||
|
129 | $ hg ci -Am addb | |||
|
130 | adding b | |||
|
131 | $ hg up 0 | |||
|
132 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |||
|
133 | $ hg --cwd .. clone -r 0 forcepush forcepush2 | |||
|
134 | requesting all changes | |||
|
135 | adding changesets | |||
|
136 | adding manifests | |||
|
137 | adding file changes | |||
|
138 | added 1 changesets with 1 changes to 1 files | |||
|
139 | updating to branch default | |||
|
140 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
141 | $ echo a >> a | |||
|
142 | $ hg qnew patch | |||
|
143 | ||||
|
144 | Pushing applied patch with --rev without --force | |||
|
145 | ||||
|
146 | $ hg push -r default ../forcepush2 | |||
|
147 | pushing to ../forcepush2 | |||
|
148 | abort: source has mq patches applied | |||
|
149 | [255] | |||
|
150 | ||||
|
151 | Pushing applied patch with branchhash, without --force | |||
|
152 | ||||
|
153 | $ hg push ../forcepush2#default | |||
|
154 | pushing to ../forcepush2 | |||
|
155 | abort: source has mq patches applied | |||
|
156 | [255] | |||
|
157 | ||||
|
158 | Pushing revs excluding applied patch | |||
|
159 | ||||
|
160 | $ hg push --new-branch -r branch -r 2 ../forcepush2 | |||
|
161 | pushing to ../forcepush2 | |||
|
162 | searching for changes | |||
|
163 | adding changesets | |||
|
164 | adding manifests | |||
|
165 | adding file changes | |||
|
166 | added 1 changesets with 1 changes to 1 files | |||
|
167 | ||||
|
168 | Pushing applied patch with --force | |||
|
169 | ||||
|
170 | $ hg push --force -r default ../forcepush2 | |||
|
171 | pushing to ../forcepush2 | |||
|
172 | searching for changes | |||
|
173 | adding changesets | |||
|
174 | adding manifests | |||
|
175 | adding file changes | |||
|
176 | added 1 changesets with 1 changes to 1 files (+1 heads) |
General Comments 0
You need to be logged in to leave comments.
Login now