##// END OF EJS Templates
merge with stable
Matt Mackall -
r19852:57479e0d merge default
parent child Browse files
Show More
@@ -0,0 +1,179 b''
1 """test behavior of propertycache and unfiltered propertycache
2
3 The repoview overlay is quite complexe. We test the behavior of
4 property cache of both localrepo and repoview to prevent
5 regression."""
6
7 import os, subprocess
8 import mercurial.localrepo
9 import mercurial.repoview
10 import mercurial.util
11 import mercurial.hg
12 import mercurial.ui as uimod
13
14
15 # create some special property cache that trace they call
16
17 calllog = []
18 @mercurial.util.propertycache
19 def testcachedfoobar(repo):
20 name = repo.filtername
21 if name is None:
22 name = ''
23 val = len(name)
24 calllog.append(val)
25 return val
26
27 unficalllog = []
28 @mercurial.localrepo.unfilteredpropertycache
29 def testcachedunfifoobar(repo):
30 name = repo.filtername
31 if name is None:
32 name = ''
33 val = 100 + len(name)
34 unficalllog.append(val)
35 return val
36
37 #plug them on repo
38 mercurial.localrepo.localrepository.testcachedfoobar = testcachedfoobar
39 mercurial.localrepo.localrepository.testcachedunfifoobar = testcachedunfifoobar
40
41
42 # create an empty repo. and instanciate it. It is important to run
43 # those test on the real object to detect regression.
44 repopath = os.path.join(os.environ['TESTTMP'], 'repo')
45 subprocess.check_call(['hg', 'init', repopath])
46 ui = uimod.ui()
47 repo = mercurial.hg.repository(ui, path=repopath).unfiltered()
48
49
50 print ''
51 print '=== property cache ==='
52 print ''
53 print 'calllog:', calllog
54 print 'cached value (unfiltered):',
55 print vars(repo).get('testcachedfoobar', 'NOCACHE')
56
57 print ''
58 print '= first access on unfiltered, should do a call'
59 print 'access:', repo.testcachedfoobar
60 print 'calllog:', calllog
61 print 'cached value (unfiltered):',
62 print vars(repo).get('testcachedfoobar', 'NOCACHE')
63
64 print ''
65 print '= second access on unfiltered, should not do call'
66 print 'access', repo.testcachedfoobar
67 print 'calllog:', calllog
68 print 'cached value (unfiltered):',
69 print vars(repo).get('testcachedfoobar', 'NOCACHE')
70
71 print ''
72 print '= first access on "visible" view, should do a call'
73 visibleview = repo.filtered('visible')
74 print 'cached value ("visible" view):',
75 print vars(visibleview).get('testcachedfoobar', 'NOCACHE')
76 print 'access:', visibleview.testcachedfoobar
77 print 'calllog:', calllog
78 print 'cached value (unfiltered):',
79 print vars(repo).get('testcachedfoobar', 'NOCACHE')
80 print 'cached value ("visible" view):',
81 print vars(visibleview).get('testcachedfoobar', 'NOCACHE')
82
83 print ''
84 print '= second access on "visible view", should not do call'
85 print 'access:', visibleview.testcachedfoobar
86 print 'calllog:', calllog
87 print 'cached value (unfiltered):',
88 print vars(repo).get('testcachedfoobar', 'NOCACHE')
89 print 'cached value ("visible" view):',
90 print vars(visibleview).get('testcachedfoobar', 'NOCACHE')
91
92 print ''
93 print '= no effect on other view'
94 immutableview = repo.filtered('immutable')
95 print 'cached value ("immutable" view):',
96 print vars(immutableview).get('testcachedfoobar', 'NOCACHE')
97 print 'access:', immutableview.testcachedfoobar
98 print 'calllog:', calllog
99 print 'cached value (unfiltered):',
100 print vars(repo).get('testcachedfoobar', 'NOCACHE')
101 print 'cached value ("visible" view):',
102 print vars(visibleview).get('testcachedfoobar', 'NOCACHE')
103 print 'cached value ("immutable" view):',
104 print vars(immutableview).get('testcachedfoobar', 'NOCACHE')
105
106 # unfiltered property cache test
107 print ''
108 print ''
109 print '=== unfiltered property cache ==='
110 print ''
111 print 'unficalllog:', unficalllog
112 print 'cached value (unfiltered): ',
113 print vars(repo).get('testcachedunfifoobar', 'NOCACHE')
114 print 'cached value ("visible" view): ',
115 print vars(visibleview).get('testcachedunfifoobar', 'NOCACHE')
116 print 'cached value ("immutable" view):',
117 print vars(immutableview).get('testcachedunfifoobar', 'NOCACHE')
118
119 print ''
120 print '= first access on unfiltered, should do a call'
121 print 'access (unfiltered):', repo.testcachedunfifoobar
122 print 'unficalllog:', unficalllog
123 print 'cached value (unfiltered): ',
124 print vars(repo).get('testcachedunfifoobar', 'NOCACHE')
125
126 print ''
127 print '= second access on unfiltered, should not do call'
128 print 'access (unfiltered):', repo.testcachedunfifoobar
129 print 'unficalllog:', unficalllog
130 print 'cached value (unfiltered): ',
131 print vars(repo).get('testcachedunfifoobar', 'NOCACHE')
132
133 print ''
134 print '= access on view should use the unfiltered cache'
135 print 'access (unfiltered): ', repo.testcachedunfifoobar
136 print 'access ("visible" view): ', visibleview.testcachedunfifoobar
137 print 'access ("immutable" view):', immutableview.testcachedunfifoobar
138 print 'unficalllog:', unficalllog
139 print 'cached value (unfiltered): ',
140 print vars(repo).get('testcachedunfifoobar', 'NOCACHE')
141 print 'cached value ("visible" view): ',
142 print vars(visibleview).get('testcachedunfifoobar', 'NOCACHE')
143 print 'cached value ("immutable" view):',
144 print vars(immutableview).get('testcachedunfifoobar', 'NOCACHE')
145
146 print ''
147 print '= even if we clear the unfiltered cache'
148 del repo.__dict__['testcachedunfifoobar']
149 print 'cached value (unfiltered): ',
150 print vars(repo).get('testcachedunfifoobar', 'NOCACHE')
151 print 'cached value ("visible" view): ',
152 print vars(visibleview).get('testcachedunfifoobar', 'NOCACHE')
153 print 'cached value ("immutable" view):',
154 print vars(immutableview).get('testcachedunfifoobar', 'NOCACHE')
155 print 'unficalllog:', unficalllog
156 print 'access ("visible" view): ', visibleview.testcachedunfifoobar
157 print 'unficalllog:', unficalllog
158 print 'cached value (unfiltered): ',
159 print vars(repo).get('testcachedunfifoobar', 'NOCACHE')
160 print 'cached value ("visible" view): ',
161 print vars(visibleview).get('testcachedunfifoobar', 'NOCACHE')
162 print 'cached value ("immutable" view):',
163 print vars(immutableview).get('testcachedunfifoobar', 'NOCACHE')
164 print 'access ("immutable" view):', immutableview.testcachedunfifoobar
165 print 'unficalllog:', unficalllog
166 print 'cached value (unfiltered): ',
167 print vars(repo).get('testcachedunfifoobar', 'NOCACHE')
168 print 'cached value ("visible" view): ',
169 print vars(visibleview).get('testcachedunfifoobar', 'NOCACHE')
170 print 'cached value ("immutable" view):',
171 print vars(immutableview).get('testcachedunfifoobar', 'NOCACHE')
172 print 'access (unfiltered): ', repo.testcachedunfifoobar
173 print 'unficalllog:', unficalllog
174 print 'cached value (unfiltered): ',
175 print vars(repo).get('testcachedunfifoobar', 'NOCACHE')
176 print 'cached value ("visible" view): ',
177 print vars(visibleview).get('testcachedunfifoobar', 'NOCACHE')
178 print 'cached value ("immutable" view):',
179 print vars(immutableview).get('testcachedunfifoobar', 'NOCACHE')
@@ -0,0 +1,84 b''
1
2 === property cache ===
3
4 calllog: []
5 cached value (unfiltered): NOCACHE
6
7 = first access on unfiltered, should do a call
8 access: 0
9 calllog: [0]
10 cached value (unfiltered): 0
11
12 = second access on unfiltered, should not do call
13 access 0
14 calllog: [0]
15 cached value (unfiltered): 0
16
17 = first access on "visible" view, should do a call
18 cached value ("visible" view): NOCACHE
19 access: 7
20 calllog: [0, 7]
21 cached value (unfiltered): 0
22 cached value ("visible" view): 7
23
24 = second access on "visible view", should not do call
25 access: 7
26 calllog: [0, 7]
27 cached value (unfiltered): 0
28 cached value ("visible" view): 7
29
30 = no effect on other view
31 cached value ("immutable" view): NOCACHE
32 access: 9
33 calllog: [0, 7, 9]
34 cached value (unfiltered): 0
35 cached value ("visible" view): 7
36 cached value ("immutable" view): 9
37
38
39 === unfiltered property cache ===
40
41 unficalllog: []
42 cached value (unfiltered): NOCACHE
43 cached value ("visible" view): NOCACHE
44 cached value ("immutable" view): NOCACHE
45
46 = first access on unfiltered, should do a call
47 access (unfiltered): 100
48 unficalllog: [100]
49 cached value (unfiltered): 100
50
51 = second access on unfiltered, should not do call
52 access (unfiltered): 100
53 unficalllog: [100]
54 cached value (unfiltered): 100
55
56 = access on view should use the unfiltered cache
57 access (unfiltered): 100
58 access ("visible" view): 100
59 access ("immutable" view): 100
60 unficalllog: [100]
61 cached value (unfiltered): 100
62 cached value ("visible" view): NOCACHE
63 cached value ("immutable" view): NOCACHE
64
65 = even if we clear the unfiltered cache
66 cached value (unfiltered): NOCACHE
67 cached value ("visible" view): NOCACHE
68 cached value ("immutable" view): NOCACHE
69 unficalllog: [100]
70 access ("visible" view): 100
71 unficalllog: [100, 100]
72 cached value (unfiltered): 100
73 cached value ("visible" view): NOCACHE
74 cached value ("immutable" view): NOCACHE
75 access ("immutable" view): 100
76 unficalllog: [100, 100]
77 cached value (unfiltered): 100
78 cached value ("visible" view): NOCACHE
79 cached value ("immutable" view): NOCACHE
80 access (unfiltered): 100
81 unficalllog: [100, 100]
82 cached value (unfiltered): 100
83 cached value ("visible" view): NOCACHE
84 cached value ("immutable" view): NOCACHE
@@ -77,3 +77,4 b' 009794acc6e37a650f0fae37872e733382ac1c0c'
77 f0d7721d7322dcfb5af33599c2543f27335334bb 0 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
@@ -90,3 +90,4 b' 009794acc6e37a650f0fae37872e733382ac1c0c'
90 f0d7721d7322dcfb5af33599c2543f27335334bb 2.7-rc
90 f0d7721d7322dcfb5af33599c2543f27335334bb 2.7-rc
91 f37b5a17e6a0ee17afde2cdde5393dd74715fb58 2.7
91 f37b5a17e6a0ee17afde2cdde5393dd74715fb58 2.7
92 335a558f81dc73afeab4d7be63617392b130117f 2.7.1
92 335a558f81dc73afeab4d7be63617392b130117f 2.7.1
93 e7fa36d2ad3a7944a52dca126458d6f482db3524 2.7.2
@@ -641,8 +641,7 b' def bootstrapcontinue(ui, repo, parentct'
641 # `parentctxnode` should match but no result. This means that
641 # `parentctxnode` should match but no result. This means that
642 # currentnode is not a descendant from parentctxnode.
642 # currentnode is not a descendant from parentctxnode.
643 msg = _('%s is not an ancestor of working directory')
643 msg = _('%s is not an ancestor of working directory')
644 hint = _('update to %s or descendant and run "hg histedit '
644 hint = _('use "histedit --abort" to clear broken state')
645 '--continue" again') % parentctx
646 raise util.Abort(msg % parentctx, hint=hint)
645 raise util.Abort(msg % parentctx, hint=hint)
647 newchildren.pop(0) # remove parentctxnode
646 newchildren.pop(0) # remove parentctxnode
648 # Commit dirty working directory if necessary
647 # Commit dirty working directory if necessary
@@ -159,8 +159,19 b' def rebase(ui, repo, **opts):'
159 if opts.get('tool', False):
159 if opts.get('tool', False):
160 ui.warn(_('tool option will be ignored\n'))
160 ui.warn(_('tool option will be ignored\n'))
161
161
162 (originalwd, target, state, skipped, collapsef, keepf,
162 try:
163 keepbranchesf, external, activebookmark) = restorestatus(repo)
163 (originalwd, target, state, skipped, collapsef, keepf,
164 keepbranchesf, external, activebookmark) = restorestatus(repo)
165 except error.RepoLookupError:
166 if abortf:
167 clearstatus(repo)
168 repo.ui.warn(_('rebase aborted (no revision is removed,'
169 ' only broken state is cleared)\n'))
170 return 0
171 else:
172 msg = _('cannot continue inconsistent rebase')
173 hint = _('use "hg rebase --abort" to clear borken state')
174 raise util.Abort(msg, hint=hint)
164 if abortf:
175 if abortf:
165 return abort(repo, originalwd, target, state)
176 return abort(repo, originalwd, target, state)
166 else:
177 else:
@@ -801,7 +812,13 b' def pullrebase(orig, ui, repo, *args, **'
801 def summaryhook(ui, repo):
812 def summaryhook(ui, repo):
802 if not os.path.exists(repo.join('rebasestate')):
813 if not os.path.exists(repo.join('rebasestate')):
803 return
814 return
804 state = restorestatus(repo)[2]
815 try:
816 state = restorestatus(repo)[2]
817 except error.RepoLookupError:
818 # i18n: column positioning for "hg summary"
819 msg = _('rebase: (use "hg rebase --abort" to clear broken state)\n')
820 ui.write(msg)
821 return
805 numrebased = len([i for i in state.itervalues() if i != -1])
822 numrebased = len([i for i in state.itervalues() if i != -1])
806 # i18n: column positioning for "hg summary"
823 # i18n: column positioning for "hg summary"
807 ui.write(_('rebase: %s, %s (rebase --continue)\n') %
824 ui.write(_('rebase: %s, %s (rebase --continue)\n') %
@@ -4262,6 +4262,12 b' msgstr "comparando com %s\\n"'
4262 msgid "no outgoing ancestors"
4262 msgid "no outgoing ancestors"
4263 msgstr "nenhum ancestral a ser enviado"
4263 msgstr "nenhum ancestral a ser enviado"
4264
4264
4265 msgid "there are ambiguous outgoing revisions"
4266 msgstr "algumas revisΓ΅es a serem enviadas sΓ£o ambΓ­guas"
4267
4268 msgid "see \"hg help histedit\" for more detail"
4269 msgstr "veja \"hg help histedit\" para mais detalhes"
4270
4265 msgid "Read history edits from the specified file."
4271 msgid "Read history edits from the specified file."
4266 msgstr "LΓͺ alteraçáes de histΓ³rico a partir do arquivo especificado."
4272 msgstr "LΓͺ alteraçáes de histΓ³rico a partir do arquivo especificado."
4267
4273
@@ -4299,12 +4305,33 b' msgstr ""'
4299 msgid ""
4305 msgid ""
4300 " With --outgoing, this edits changesets not found in the\n"
4306 " With --outgoing, this edits changesets not found in the\n"
4301 " destination repository. If URL of the destination is omitted, the\n"
4307 " destination repository. If URL of the destination is omitted, the\n"
4302 " 'default-push' (or 'default') path will be used.\n"
4308 " 'default-push' (or 'default') path will be used."
4303 " "
4304 msgstr ""
4309 msgstr ""
4305 " Com --outgoing, edita revisΓ΅es nΓ£o encontradas no repositΓ³rio de\n"
4310 " Com --outgoing, edita revisΓ΅es nΓ£o encontradas no repositΓ³rio de\n"
4306 " destino. Se a URL do destino for omitida, o caminho definido em\n"
4311 " destino. Se a URL do destino for omitida, o caminho definido em\n"
4307 " 'default-push' (ou 'default') serΓ‘ usado.\n"
4312 " 'default-push' (ou 'default') serΓ‘ usado."
4313
4314 msgid ""
4315 " For safety, this command is aborted, also if there are ambiguous\n"
4316 " outgoing revisions which may confuse users: for example, there are\n"
4317 " multiple branches containing outgoing revisions."
4318 msgstr ""
4319 " Por segurança, este comando também é abortado se o conjunto de\n"
4320 " revisΓ΅es a serem enviadas for ambΓ­guo, pois isso pode confundir\n"
4321 " os usuΓ‘rios: por exemplo, se vΓ‘rios ramos possuΓ­rem revisΓ΅es a\n"
4322 " serem enviadas."
4323
4324 msgid ""
4325 " Use \"min(outgoing() and ::.)\" or similar revset specification\n"
4326 " instead of --outgoing to specify edit target revision exactly in\n"
4327 " such ambiguous situation. See :hg:`help revsets` for detail about\n"
4328 " selecting revisions.\n"
4329 " "
4330 msgstr ""
4331 " Ao invΓ©s de --outgoing, use \"min(outgoing() and ::.)\" ou outro\n"
4332 " revset semelhante para especificar com exatidΓ£o as revisΓ΅es a serem\n"
4333 " editadas nessas situaçáes.Veja :hg:`help revsets` para detalhes sobre\n"
4334 " seleção de revisáes.\n"
4308 " "
4335 " "
4309
4336
4310 msgid "source has mq patches applied"
4337 msgid "source has mq patches applied"
@@ -39,9 +39,10 b' class unfilteredpropertycache(propertyca'
39 """propertycache that apply to unfiltered repo only"""
39 """propertycache that apply to unfiltered repo only"""
40
40
41 def __get__(self, repo, type=None):
41 def __get__(self, repo, type=None):
42 if hasunfilteredcache(repo, self.name):
42 unfi = repo.unfiltered()
43 return getattr(repo.unfiltered(), self.name)
43 if unfi is repo:
44 return super(unfilteredpropertycache, self).__get__(repo.unfiltered())
44 return super(unfilteredpropertycache, self).__get__(unfi)
45 return getattr(unfi, self.name)
45
46
46 class filteredpropertycache(propertycache):
47 class filteredpropertycache(propertycache):
47 """propertycache that must take filtering in account"""
48 """propertycache that must take filtering in account"""
@@ -283,7 +283,8 b' class propertycache(object):'
283 return result
283 return result
284
284
285 def cachevalue(self, obj, value):
285 def cachevalue(self, obj, value):
286 setattr(obj, self.name, value)
286 # __dict__ assigment required to bypass __setattr__ (eg: repoview)
287 obj.__dict__[self.name] = value
287
288
288 def pipefilter(s, cmd):
289 def pipefilter(s, cmd):
289 '''filter string S through command CMD, returning its output'''
290 '''filter string S through command CMD, returning its output'''
@@ -70,6 +70,35 b' Run on a revision not ancestors of the c'
70 [255]
70 [255]
71 $ hg up --quiet
71 $ hg up --quiet
72
72
73 Run on a revision not descendants of the initial parent
74 --------------------------------------------------------------------
75
76 Test the message shown for inconsistent histedit state, which may be
77 created (and forgotten) by Mercurial earlier than 2.7. This emulates
78 Mercurial earlier than 2.7 by renaming ".hg/histedit-state"
79 temporarily.
80
81 $ HGEDITOR=cat hg histedit -r 4 --commands - << EOF
82 > edit 08d98a8350f3 4 five
83 > EOF
84 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
85 reverting alpha
86 Make changes as needed, you may commit or record as needed now.
87 When you are finished, run hg histedit --continue to resume.
88 [1]
89
90 $ mv .hg/histedit-state .hg/histedit-state.back
91 $ hg update --quiet --clean 2
92 $ mv .hg/histedit-state.back .hg/histedit-state
93
94 $ hg histedit --continue
95 abort: c8e68270e35a is not an ancestor of working directory
96 (use "histedit --abort" to clear broken state)
97 [255]
98
99 $ hg histedit --abort
100 $ hg update --quiet --clean
101
73 Test that missing revisions are detected
102 Test that missing revisions are detected
74 ---------------------------------------
103 ---------------------------------------
75
104
@@ -75,6 +75,31 b' Abort:'
75 |
75 |
76 o 0:draft 'C1'
76 o 0:draft 'C1'
77
77
78 Test safety for inconsistent rebase state, which may be created (and
79 forgotten) by Mercurial earlier than 2.7. This emulates Mercurial
80 earlier than 2.7 by renaming ".hg/rebasestate" temporarily.
81
82 $ hg rebase -s 3 -d 2
83 merging common
84 warning: conflicts during merge.
85 merging common incomplete! (edit conflicts, then use 'hg resolve --mark')
86 unresolved conflicts (see hg resolve, then hg rebase --continue)
87 [1]
88
89 $ mv .hg/rebasestate .hg/rebasestate.back
90 $ hg update --quiet --clean 2
91 $ hg --config extensions.mq= strip --quiet "destination()"
92 $ mv .hg/rebasestate.back .hg/rebasestate
93
94 $ hg rebase --continue
95 abort: cannot continue inconsistent rebase
96 (use "hg rebase --abort" to clear borken state)
97 [255]
98 $ hg summary | grep '^rebase: '
99 rebase: (use "hg rebase --abort" to clear broken state)
100 $ hg rebase --abort
101 rebase aborted (no revision is removed, only broken state is cleared)
102
78 $ cd ..
103 $ cd ..
79
104
80
105
General Comments 0
You need to be logged in to leave comments. Login now