Show More
@@ -509,7 +509,8 b' class queue:' | |||||
509 | p1, p2 = repo.dirstate.parents() |
|
509 | p1, p2 = repo.dirstate.parents() | |
510 | repo.dirstate.setparents(p1, merge) |
|
510 | repo.dirstate.setparents(p1, merge) | |
511 | files = patch.updatedir(self.ui, repo, files) |
|
511 | files = patch.updatedir(self.ui, repo, files) | |
512 |
n = repo.commit(files, message, user, date, |
|
512 | n = repo.commit(files, message, user, date, match=util.never, | |
|
513 | force=True) | |||
513 |
|
514 | |||
514 | if n == None: |
|
515 | if n == None: | |
515 | raise util.Abort(_("repo commit failed")) |
|
516 | raise util.Abort(_("repo commit failed")) |
@@ -505,3 +505,35 b' hg qnew -f -e changea' | |||||
505 | hg qpop |
|
505 | hg qpop | |
506 | hg qpush |
|
506 | hg qpush | |
507 | cd .. |
|
507 | cd .. | |
|
508 | ||||
|
509 | echo % test qpush with --force, issue1087 | |||
|
510 | hg init forcepush | |||
|
511 | cd forcepush | |||
|
512 | echo hello > hello.txt | |||
|
513 | echo bye > bye.txt | |||
|
514 | hg ci -Ama | |||
|
515 | hg qnew -d '0 0' empty | |||
|
516 | hg qpop | |||
|
517 | echo world >> hello.txt | |||
|
518 | ||||
|
519 | echo % qpush should fail, local changes | |||
|
520 | hg qpush | |||
|
521 | ||||
|
522 | echo % apply force, should not discard changes with empty patch | |||
|
523 | hg qpush -f | |||
|
524 | hg diff --config diff.nodates=True | |||
|
525 | hg qdiff --config diff.nodates=True | |||
|
526 | hg log -l1 -p | |||
|
527 | hg qref -d '0 0' | |||
|
528 | hg qpop | |||
|
529 | echo universe >> hello.txt | |||
|
530 | echo universe >> bye.txt | |||
|
531 | ||||
|
532 | echo % qpush should fail, local changes | |||
|
533 | hg qpush | |||
|
534 | ||||
|
535 | echo % apply force, should discard changes in hello, but not bye | |||
|
536 | hg qpush -f | |||
|
537 | hg st | |||
|
538 | hg diff --config diff.nodates=True | |||
|
539 | hg qdiff --config diff.nodates=True |
@@ -490,3 +490,63 b' adding a' | |||||
490 | Patch queue now empty |
|
490 | Patch queue now empty | |
491 | applying changea |
|
491 | applying changea | |
492 | Now at: changea |
|
492 | Now at: changea | |
|
493 | % test qpush with --force, issue1087 | |||
|
494 | adding bye.txt | |||
|
495 | adding hello.txt | |||
|
496 | Patch queue now empty | |||
|
497 | % qpush should fail, local changes | |||
|
498 | abort: local changes found, refresh first | |||
|
499 | % apply force, should not discard changes with empty patch | |||
|
500 | applying empty | |||
|
501 | /usr/bin/patch: **** Only garbage was found in the patch input. | |||
|
502 | patch failed, unable to continue (try -v) | |||
|
503 | patch empty is empty | |||
|
504 | Now at: empty | |||
|
505 | diff -r bf5fc3f07a0a hello.txt | |||
|
506 | --- a/hello.txt | |||
|
507 | +++ b/hello.txt | |||
|
508 | @@ -1,1 +1,2 @@ | |||
|
509 | hello | |||
|
510 | +world | |||
|
511 | diff -r 9ecee4f634e3 hello.txt | |||
|
512 | --- a/hello.txt | |||
|
513 | +++ b/hello.txt | |||
|
514 | @@ -1,1 +1,2 @@ | |||
|
515 | hello | |||
|
516 | +world | |||
|
517 | changeset: 1:bf5fc3f07a0a | |||
|
518 | tag: qtip | |||
|
519 | tag: tip | |||
|
520 | tag: empty | |||
|
521 | tag: qbase | |||
|
522 | user: test | |||
|
523 | date: Thu Jan 01 00:00:00 1970 +0000 | |||
|
524 | summary: imported patch empty | |||
|
525 | ||||
|
526 | ||||
|
527 | Patch queue now empty | |||
|
528 | % qpush should fail, local changes | |||
|
529 | abort: local changes found, refresh first | |||
|
530 | % apply force, should discard changes in hello, but not bye | |||
|
531 | applying empty | |||
|
532 | Now at: empty | |||
|
533 | M bye.txt | |||
|
534 | diff -r ba252371dbc1 bye.txt | |||
|
535 | --- a/bye.txt | |||
|
536 | +++ b/bye.txt | |||
|
537 | @@ -1,1 +1,2 @@ | |||
|
538 | bye | |||
|
539 | +universe | |||
|
540 | diff -r 9ecee4f634e3 bye.txt | |||
|
541 | --- a/bye.txt | |||
|
542 | +++ b/bye.txt | |||
|
543 | @@ -1,1 +1,2 @@ | |||
|
544 | bye | |||
|
545 | +universe | |||
|
546 | diff -r 9ecee4f634e3 hello.txt | |||
|
547 | --- a/hello.txt | |||
|
548 | +++ b/hello.txt | |||
|
549 | @@ -1,1 +1,3 @@ | |||
|
550 | hello | |||
|
551 | +world | |||
|
552 | +universe |
General Comments 0
You need to be logged in to leave comments.
Login now