##// END OF EJS Templates
phabricator: prevent posting obsolete commits...
Matt Harbison -
r45213:c482e2fe default
parent child Browse files
Show More
@@ -1304,6 +1304,9 b' def phabsend(ui, repo, *revs, **opts):'
1304 1304
1305 1305 ctxs = [repo[rev] for rev in revs]
1306 1306
1307 if any(c for c in ctxs if c.obsolete()):
1308 raise error.Abort(_(b"obsolete commits cannot be posted for review"))
1309
1307 1310 fold = opts.get(b'fold')
1308 1311 if fold:
1309 1312 if len(revs) == 1:
@@ -229,6 +229,58 b' of new revisions.'
229 229 o 0 5cbade24e0fa 1970-01-01 00:00 +0000 test
230 230 added
231 231
232 Posting obsolete commits is disallowed
233
234 $ echo "mod3" > file1.txt
235 $ hg ci -m 'modified A'
236 $ echo "mod4" > file1.txt
237 $ hg ci -m 'modified B'
238
239 $ hg up '.^'
240 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
241 $ echo 'obsolete' > file1.txt
242 $ hg amend --config extensions.amend=
243 1 new orphan changesets
244 $ hg log -G
245 @ changeset: 8:8d83edb3cbac
246 | tag: tip
247 | parent: 5:1dff6b051abf
248 | user: test
249 | date: Thu Jan 01 00:00:00 1970 +0000
250 | summary: modified A
251 |
252 | * changeset: 7:d4ea1b2e3511
253 | | user: test
254 | | date: Thu Jan 01 00:00:00 1970 +0000
255 | | instability: orphan
256 | | summary: modified B
257 | |
258 | x changeset: 6:4635d7f0d1ff
259 |/ user: test
260 | date: Thu Jan 01 00:00:00 1970 +0000
261 | obsolete: rewritten using amend as 8:8d83edb3cbac
262 | summary: modified A
263 |
264 o changeset: 5:1dff6b051abf
265 | user: test
266 | date: Thu Jan 01 00:00:00 1970 +0000
267 | summary: modified 2
268 |
269 o changeset: 4:eb3752621d45
270 | parent: 0:5cbade24e0fa
271 | user: test
272 | date: Thu Jan 01 00:00:00 1970 +0000
273 | summary: modified 1
274 |
275 o changeset: 0:5cbade24e0fa
276 user: test
277 date: Thu Jan 01 00:00:00 1970 +0000
278 summary: added
279
280 $ hg phabsend -r 5::
281 abort: obsolete commits cannot be posted for review
282 [255]
283
232 284 $ cd ..
233 285
234 286 Phabesending a new binary, a modified binary, and a removed binary
General Comments 0
You need to be logged in to leave comments. Login now