Show More
@@ -93,7 +93,8 nokwcommands = ('add addremove annotate | |||||
93 |
|
93 | |||
94 | # hg commands that trigger expansion only when writing to working dir, |
|
94 | # hg commands that trigger expansion only when writing to working dir, | |
95 | # not when reading filelog, and unexpand when reading from working dir |
|
95 | # not when reading filelog, and unexpand when reading from working dir | |
96 | restricted = 'merge record resolve qfold qimport qnew qpush qrefresh qrecord' |
|
96 | restricted = ('merge record resolve qfold qimport qnew qpush qrefresh qrecord' | |
|
97 | ' transplant') | |||
97 |
|
98 | |||
98 | # provide cvs-like UTC date filter |
|
99 | # provide cvs-like UTC date filter | |
99 | utcdate = lambda x: util.datestr(x, '%Y/%m/%d %H:%M:%S') |
|
100 | utcdate = lambda x: util.datestr(x, '%Y/%m/%d %H:%M:%S') | |
@@ -537,6 +538,7 def reposetup(ui, repo): | |||||
537 | repo.__class__ = kwrepo |
|
538 | repo.__class__ = kwrepo | |
538 |
|
539 | |||
539 | extensions.wrapfunction(patch.patchfile, '__init__', kwpatchfile_init) |
|
540 | extensions.wrapfunction(patch.patchfile, '__init__', kwpatchfile_init) | |
|
541 | if not kwt.restrict: | |||
540 | extensions.wrapfunction(patch, 'diff', kw_diff) |
|
542 | extensions.wrapfunction(patch, 'diff', kw_diff) | |
541 | for c in 'annotate changeset rev filediff diff'.split(): |
|
543 | for c in 'annotate changeset rev filediff diff'.split(): | |
542 | extensions.wrapfunction(webcommands, c, kwweb_skip) |
|
544 | extensions.wrapfunction(webcommands, c, kwweb_skip) |
@@ -5,6 +5,7 cat <<EOF >> $HGRCPATH | |||||
5 | hgext.keyword = |
|
5 | hgext.keyword = | |
6 | hgext.mq = |
|
6 | hgext.mq = | |
7 | hgext.notify = |
|
7 | hgext.notify = | |
|
8 | hgext.transplant = | |||
8 | EOF |
|
9 | EOF | |
9 |
|
10 | |||
10 | # demo before [keyword] files are set up |
|
11 | # demo before [keyword] files are set up | |
@@ -337,6 +338,23 HGMERGE=internal:local hg resolve -a | |||||
337 | hg commit -m localresolve |
|
338 | hg commit -m localresolve | |
338 | cat m |
|
339 | cat m | |
339 |
|
340 | |||
|
341 | echo % test restricted mode with transplant -b | |||
|
342 | hg update 6 | |||
|
343 | hg branch foo | |||
|
344 | mv a a.bak | |||
|
345 | echo foobranch > a | |||
|
346 | cat a.bak >> a | |||
|
347 | rm a.bak | |||
|
348 | hg commit -m 9foobranch | |||
|
349 | hg update default | |||
|
350 | hg -y transplant -b foo tip | |||
|
351 | echo % no expansion in changeset | |||
|
352 | hg tip -p | |||
|
353 | echo % expansion in file | |||
|
354 | head -n 2 a | |||
|
355 | hg -q rollback | |||
|
356 | hg -q update -C | |||
|
357 | ||||
340 | echo % switch off expansion |
|
358 | echo % switch off expansion | |
341 | echo % kwshrink with unknown file u |
|
359 | echo % kwshrink with unknown file u | |
342 | cp a u |
|
360 | cp a u |
@@ -420,6 +420,33 foo | |||||
420 | % resolve to local |
|
420 | % resolve to local | |
421 | $Id: m 43dfd2854b5b Thu, 01 Jan 1970 00:00:00 +0000 test $ |
|
421 | $Id: m 43dfd2854b5b Thu, 01 Jan 1970 00:00:00 +0000 test $ | |
422 | bar |
|
422 | bar | |
|
423 | % test restricted mode with transplant -b | |||
|
424 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
425 | marked working directory as branch foo | |||
|
426 | created new head | |||
|
427 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
428 | applying 1c4378f51c4d | |||
|
429 | 1c4378f51c4d transplanted to 7d855abcab87 | |||
|
430 | % no expansion in changeset | |||
|
431 | changeset: 11:7d855abcab87 | |||
|
432 | tag: tip | |||
|
433 | parent: 9:43dfd2854b5b | |||
|
434 | user: test | |||
|
435 | date: Thu Jan 01 00:00:00 1970 +0000 | |||
|
436 | summary: 9foobranch | |||
|
437 | ||||
|
438 | diff -r 43dfd2854b5b -r 7d855abcab87 a | |||
|
439 | --- a/a Thu Jan 01 00:00:00 1970 +0000 | |||
|
440 | +++ b/a Thu Jan 01 00:00:00 1970 +0000 | |||
|
441 | @@ -1,3 +1,4 @@ | |||
|
442 | +foobranch | |||
|
443 | expand $Id$ | |||
|
444 | do not process $Id: | |||
|
445 | xxx $ | |||
|
446 | ||||
|
447 | % expansion in file | |||
|
448 | foobranch | |||
|
449 | expand $Id: a 7d855abcab87 Thu, 01 Jan 1970 00:00:00 +0000 test $ | |||
423 | % switch off expansion |
|
450 | % switch off expansion | |
424 | % kwshrink with unknown file u |
|
451 | % kwshrink with unknown file u | |
425 | overwriting a shrinking keywords |
|
452 | overwriting a shrinking keywords |
General Comments 0
You need to be logged in to leave comments.
Login now