##// END OF EJS Templates
mq: let the user choose where .orig files are kept...
Christian Delahousse -
r26943:263edb59 default
parent child Browse files
Show More
@@ -697,11 +697,13 class queue(object):
697 697 absf = repo.wjoin(f)
698 698 if os.path.lexists(absf):
699 699 self.ui.note(_('saving current version of %s as %s\n') %
700 (f, f + '.orig'))
700 (f, cmdutil.origpath(self.ui, repo, f)))
701
702 absorig = cmdutil.origpath(self.ui, repo, absf)
701 703 if copy:
702 util.copyfile(absf, absf + '.orig')
704 util.copyfile(absf, absorig)
703 705 else:
704 util.rename(absf, absf + '.orig')
706 util.rename(absf, absorig)
705 707
706 708 def printdiff(self, repo, diffopts, node1, node2=None, files=None,
707 709 fp=None, changes=None, opts={}):
@@ -444,7 +444,7 test mq.keepchanges setting
444 444 $ hg st a
445 445 M a
446 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 448 popping p3
449 449 now at: p2
450 450 $ hg st b
@@ -461,4 +461,10 test mq.keepchanges setting
461 461 now at: p2
462 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 470 $ cd ..
@@ -1394,9 +1394,10 qpush should fail, local changes
1394 1394
1395 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 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 1401 patching file hello.txt
1401 1402 committing files:
1402 1403 hello.txt
@@ -1405,7 +1406,6 apply force, should discard changes in h
1405 1406 now at: empty
1406 1407 $ hg st
1407 1408 M bye.txt
1408 ? hello.txt.orig
1409 1409 $ hg diff --config diff.nodates=True
1410 1410 diff -r ba252371dbc1 bye.txt
1411 1411 --- a/bye.txt
@@ -1428,6 +1428,10 apply force, should discard changes in h
1428 1428 +world
1429 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 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