##// END OF EJS Templates
keyword: safeguards against erroneous behaviour or aborts...
Christian Ebert -
r6051:1038b145 default
parent child Browse files
Show More
@@ -88,7 +88,7 b" commands.optionalrepo += ' kwdemo'"
88 88
89 89 # hg commands that do not act on keywords
90 90 nokwcommands = ('add addremove bundle copy export grep identify incoming init'
91 ' log outgoing push remove rename rollback tip convert')
91 ' log outgoing push remove rename rollback tip convert email')
92 92
93 93 # hg commands that trigger expansion only when writing to working dir,
94 94 # not when reading filelog, and unexpand when reading from working dir
@@ -410,8 +410,12 b' def reposetup(ui, repo):'
410 410 This is done for local repos only, and only if there are
411 411 files configured at all for keyword substitution.'''
412 412
413 if not repo.local():
414 return
413 try:
414 if (not repo.local() or '.hg' in repo.root.split('/')
415 or repo._url.startswith('bundle:')):
416 return
417 except AttributeError:
418 pass
415 419
416 420 hgcmd, func, args, opts, cmdopts = dispatch._parse(ui, sys.argv[1:])
417 421 if hgcmd in nokwcommands.split():
@@ -426,7 +430,7 b' def reposetup(ui, repo):'
426 430 if node1 is not None and node1 != repo.changectx().node():
427 431 hgcmd = 'diff1'
428 432
429 inc, exc = [], ['.hgtags']
433 inc, exc = [], ['.hg*']
430 434 for pat, opt in ui.configitems('keyword'):
431 435 if opt != 'ignore':
432 436 inc.append(pat)
@@ -24,8 +24,8 b' hg --quiet kwdemo --default \\'
24 24
25 25 hg --quiet kwdemo "Branch = {branches}"
26 26
27 hg init Test
28 cd Test
27 hg init Test-bndl
28 cd Test-bndl
29 29
30 30 echo % kwshrink should exit silently in empty/invalid repo
31 31 hg kwshrink
@@ -69,6 +69,16 b" sed -e '/\\[hooks\\]/,$ d' $HGRCPATH > $HG"
69 69 mv $HGRCPATH.nohook $HGRCPATH
70 70 rm hooktest
71 71
72 echo % bundle
73 hg bundle --base null ../kw.hg
74
75 cd ..
76 hg init Test
77 cd Test
78
79 echo % pull from bundle
80 hg pull -u ../kw.hg
81
72 82 echo % touch
73 83 touch a b
74 84 echo % status
@@ -90,8 +100,12 b' hg -v kwexpand'
90 100 echo % compare changenodes in a c
91 101 cat a c
92 102
103 echo % qinit -c
104 hg qinit -c
93 105 echo % qimport
94 106 hg qimport -r tip -n mqtest.diff
107 echo % qcommit
108 hg qcommit -mqtest
95 109 echo % keywords should not be expanded in patch
96 110 cat .hg/patches/mqtest.diff
97 111 echo % qpop
@@ -138,6 +138,16 b' ignore $Id$'
138 138 a
139 139 % diff a hooktest
140 140 % removing commit hook from config
141 % bundle
142 1 changesets found
143 % pull from bundle
144 pulling from ../kw.hg
145 requesting all changes
146 adding changesets
147 adding manifests
148 adding file changes
149 added 1 changesets with 3 changes to 3 files
150 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
141 151 % touch
142 152 % status
143 153 % update
@@ -162,7 +172,9 b' do not process $Id:'
162 172 xxx $
163 173 $Id: c,v ba4426d1938e 1970/01/01 00:00:01 user $
164 174 tests for different changenodes
175 % qinit -c
165 176 % qimport
177 % qcommit
166 178 % keywords should not be expanded in patch
167 179 # HG changeset patch
168 180 # User User Name <user@example.com>
General Comments 0
You need to be logged in to leave comments. Login now