Show More
@@ -697,11 +697,13 b' class queue(object):' | |||||
697 | absf = repo.wjoin(f) |
|
697 | absf = repo.wjoin(f) | |
698 | if os.path.lexists(absf): |
|
698 | if os.path.lexists(absf): | |
699 | self.ui.note(_('saving current version of %s as %s\n') % |
|
699 | self.ui.note(_('saving current version of %s as %s\n') % | |
700 |
(f, f |
|
700 | (f, cmdutil.origpath(self.ui, repo, f))) | |
|
701 | ||||
|
702 | absorig = cmdutil.origpath(self.ui, repo, absf) | |||
701 | if copy: |
|
703 | if copy: | |
702 |
util.copyfile(absf, abs |
|
704 | util.copyfile(absf, absorig) | |
703 | else: |
|
705 | else: | |
704 |
util.rename(absf, abs |
|
706 | util.rename(absf, absorig) | |
705 |
|
707 | |||
706 | def printdiff(self, repo, diffopts, node1, node2=None, files=None, |
|
708 | def printdiff(self, repo, diffopts, node1, node2=None, files=None, | |
707 | fp=None, changes=None, opts={}): |
|
709 | fp=None, changes=None, opts={}): |
@@ -444,7 +444,7 b' test mq.keepchanges setting' | |||||
444 | $ hg st a |
|
444 | $ hg st a | |
445 | M a |
|
445 | M a | |
446 | $ echo b >> b |
|
446 | $ echo b >> b | |
447 | $ hg --config mq.keepchanges=1 qpop --force |
|
447 | $ hg --config mq.keepchanges=1 qpop --force --config 'ui.origbackuppath=.hg/origbackups' | |
448 | popping p3 |
|
448 | popping p3 | |
449 | now at: p2 |
|
449 | now at: p2 | |
450 | $ hg st b |
|
450 | $ hg st b | |
@@ -461,4 +461,10 b' test mq.keepchanges setting' | |||||
461 | now at: p2 |
|
461 | now at: p2 | |
462 | $ hg st a |
|
462 | $ hg st a | |
463 |
|
463 | |||
|
464 | test previous qpop (with --force and --config) saved .orig files to where user | |||
|
465 | wants them | |||
|
466 | $ ls .hg/origbackups | |||
|
467 | b.orig | |||
|
468 | $ rm -rf .hg/origbackups | |||
|
469 | ||||
464 | $ cd .. |
|
470 | $ cd .. |
@@ -1394,9 +1394,10 b' qpush should fail, local changes' | |||||
1394 |
|
1394 | |||
1395 | apply force, should discard changes in hello, but not bye |
|
1395 | apply force, should discard changes in hello, but not bye | |
1396 |
|
1396 | |||
1397 | $ hg qpush -f --verbose |
|
1397 | $ hg qpush -f --verbose --config 'ui.origbackuppath=.hg/origbackups' | |
1398 | applying empty |
|
1398 | applying empty | |
1399 | saving current version of hello.txt as hello.txt.orig |
|
1399 | creating directory: $TESTTMP/forcepush/.hg/origbackups | |
|
1400 | saving current version of hello.txt as $TESTTMP/forcepush/.hg/origbackups/hello.txt.orig | |||
1400 | patching file hello.txt |
|
1401 | patching file hello.txt | |
1401 | committing files: |
|
1402 | committing files: | |
1402 | hello.txt |
|
1403 | hello.txt | |
@@ -1405,7 +1406,6 b' apply force, should discard changes in h' | |||||
1405 | now at: empty |
|
1406 | now at: empty | |
1406 | $ hg st |
|
1407 | $ hg st | |
1407 | M bye.txt |
|
1408 | M bye.txt | |
1408 | ? hello.txt.orig |
|
|||
1409 | $ hg diff --config diff.nodates=True |
|
1409 | $ hg diff --config diff.nodates=True | |
1410 | diff -r ba252371dbc1 bye.txt |
|
1410 | diff -r ba252371dbc1 bye.txt | |
1411 | --- a/bye.txt |
|
1411 | --- a/bye.txt | |
@@ -1428,6 +1428,10 b' apply force, should discard changes in h' | |||||
1428 | +world |
|
1428 | +world | |
1429 | +universe |
|
1429 | +universe | |
1430 |
|
1430 | |||
|
1431 | test that the previous call to qpush with -f (--force) and --config actually put | |||
|
1432 | the orig files out of the working copy | |||
|
1433 | $ ls .hg/origbackups | |||
|
1434 | hello.txt.orig | |||
1431 |
|
1435 | |||
1432 | test popping revisions not in working dir ancestry |
|
1436 | test popping revisions not in working dir ancestry | |
1433 |
|
1437 |
General Comments 0
You need to be logged in to leave comments.
Login now