##// END OF EJS Templates
filtering: rename filters to their antonyms...
Kevin Bullock -
r18382:f3b21beb default
parent child Browse files
Show More
@@ -212,7 +212,7 b' class changectx(object):'
212 212 def mutable(self):
213 213 return self.phase() > phases.public
214 214 def hidden(self):
215 return self._rev in repoview.filteredrevs(self._repo, 'hidden')
215 return self._rev in repoview.filterrevs(self._repo, 'visible')
216 216
217 217 def parents(self):
218 218 """return contexts for each parent changeset"""
@@ -115,7 +115,7 b' def findcommonoutgoing(repo, other, only'
115 115 og.missingheads = onlyheads or repo.heads()
116 116 elif onlyheads is None:
117 117 # use visible heads as it should be cached
118 og.missingheads = repo.filtered("unserved").heads()
118 og.missingheads = repo.filtered("served").heads()
119 119 og.excluded = [ctx.node() for ctx in repo.set('secret() or extinct()')]
120 120 else:
121 121 # compute common, missing and exclude secret stuff
@@ -113,7 +113,7 b" def repository(ui, path='', create=False"
113 113 if not repo:
114 114 raise util.Abort(_("repository '%s' is not local") %
115 115 (path or peer.url()))
116 return repo.filtered('hidden')
116 return repo.filtered('visible')
117 117
118 118 def peer(uiorrepo, opts, path, create=False):
119 119 '''return a repository peer for the specified path'''
@@ -66,7 +66,7 b' class localpeer(peer.peerrepository):'
66 66
67 67 def __init__(self, repo, caps=MODERNCAPS):
68 68 peer.peerrepository.__init__(self)
69 self._repo = repo.filtered('unserved')
69 self._repo = repo.filtered('served')
70 70 self.ui = repo.ui
71 71 self._caps = repo._restrictcapabilities(caps)
72 72 self.requirements = repo.requirements
@@ -44,7 +44,7 b' def computeunserved(repo):'
44 44 Secret and hidden changeset should not pretend to be here."""
45 45 assert not repo.changelog.filteredrevs
46 46 # fast path in simple case to avoid impact of non optimised code
47 hiddens = filteredrevs(repo, 'hidden')
47 hiddens = filterrevs(repo, 'visible')
48 48 if phases.hassecret(repo):
49 49 cl = repo.changelog
50 50 secret = phases.secret
@@ -65,7 +65,7 b' def computemutable(repo):'
65 65 # fast check to avoid revset call on huge repo
66 66 if util.any(repo._phasecache.phaseroots[1:]):
67 67 getphase = repo._phasecache.phase
68 maymutable = filteredrevs(repo, 'impactable')
68 maymutable = filterrevs(repo, 'base')
69 69 return frozenset(r for r in maymutable if getphase(repo, r))
70 70 return frozenset()
71 71
@@ -93,22 +93,22 b' def computeimpactable(repo):'
93 93 return frozenset(xrange(firstmutable, len(cl)))
94 94
95 95 # function to compute filtered set
96 filtertable = {'hidden': computehidden,
97 'unserved': computeunserved,
98 'mutable': computemutable,
99 'impactable': computeimpactable}
96 filtertable = {'visible': computehidden,
97 'served': computeunserved,
98 'immutable': computemutable,
99 'base': computeimpactable}
100 100 ### Nearest subset relation
101 101 # Nearest subset of filter X is a filter Y so that:
102 102 # * Y is included in X,
103 103 # * X - Y is as small as possible.
104 104 # This create and ordering used for branchmap purpose.
105 105 # the ordering may be partial
106 subsettable = {None: 'hidden',
107 'hidden': 'unserved',
108 'unserved': 'mutable',
109 'mutable': 'impactable'}
106 subsettable = {None: 'visible',
107 'visible': 'served',
108 'served': 'immutable',
109 'immutable': 'base'}
110 110
111 def filteredrevs(repo, filtername):
111 def filterrevs(repo, filtername):
112 112 """returns set of filtered revision for this filter name"""
113 113 if filtername not in repo.filteredrevcache:
114 114 func = filtertable[filtername]
@@ -162,7 +162,7 b' class repoview(object):'
162 162 this changelog must not be used for writing"""
163 163 # some cache may be implemented later
164 164 cl = copy.copy(self._unfilteredrepo.changelog)
165 cl.filteredrevs = filteredrevs(self._unfilteredrepo, self.filtername)
165 cl.filteredrevs = filterrevs(self._unfilteredrepo, self.filtername)
166 166 return cl
167 167
168 168 def unfiltered(self):
@@ -893,7 +893,7 b' def hidden(repo, subset, x):'
893 893 """
894 894 # i18n: "hidden" is a keyword
895 895 getargs(x, 0, 0, _("hidden takes no arguments"))
896 hiddenrevs = repoview.filteredrevs(repo, 'hidden')
896 hiddenrevs = repoview.filterrevs(repo, 'visible')
897 897 return [r for r in subset if r in hiddenrevs]
898 898
899 899 def keyword(repo, subset, x):
@@ -345,7 +345,7 b' class ooberror(object):'
345 345 self.message = message
346 346
347 347 def dispatch(repo, proto, command):
348 repo = repo.filtered("unserved")
348 repo = repo.filtered("served")
349 349 func, spec = commands[command]
350 350 args = proto.getargs(spec)
351 351 return func(repo, proto, *args)
@@ -362,7 +362,7 b' def options(cmd, keys, others):'
362 362 return opts
363 363
364 364 def batch(repo, proto, cmds, others):
365 repo = repo.filtered("unserved")
365 repo = repo.filtered("served")
366 366 res = []
367 367 for pair in cmds.split(';'):
368 368 op, args = pair.split(' ', 1)
@@ -140,7 +140,7 b' Extension disabled for lack of acl.sourc'
140 140 query 1; heads
141 141 searching for changes
142 142 all remote heads known locally
143 invalid branchheads cache (unserved): tip differs
143 invalid branchheads cache (served): tip differs
144 144 listing keys for "bookmarks"
145 145 3 changesets found
146 146 list of changesets:
@@ -202,7 +202,7 b' No [acl.allow]/[acl.deny]'
202 202 query 1; heads
203 203 searching for changes
204 204 all remote heads known locally
205 invalid branchheads cache (unserved): tip differs
205 invalid branchheads cache (served): tip differs
206 206 listing keys for "bookmarks"
207 207 3 changesets found
208 208 list of changesets:
@@ -274,7 +274,7 b' Empty [acl.allow]'
274 274 query 1; heads
275 275 searching for changes
276 276 all remote heads known locally
277 invalid branchheads cache (unserved): tip differs
277 invalid branchheads cache (served): tip differs
278 278 listing keys for "bookmarks"
279 279 3 changesets found
280 280 list of changesets:
@@ -341,7 +341,7 b' fred is allowed inside foo/'
341 341 query 1; heads
342 342 searching for changes
343 343 all remote heads known locally
344 invalid branchheads cache (unserved): tip differs
344 invalid branchheads cache (served): tip differs
345 345 listing keys for "bookmarks"
346 346 3 changesets found
347 347 list of changesets:
@@ -413,7 +413,7 b' Empty [acl.deny]'
413 413 query 1; heads
414 414 searching for changes
415 415 all remote heads known locally
416 invalid branchheads cache (unserved): tip differs
416 invalid branchheads cache (served): tip differs
417 417 listing keys for "bookmarks"
418 418 3 changesets found
419 419 list of changesets:
@@ -482,7 +482,7 b' fred is allowed inside foo/, but not foo'
482 482 query 1; heads
483 483 searching for changes
484 484 all remote heads known locally
485 invalid branchheads cache (unserved): tip differs
485 invalid branchheads cache (served): tip differs
486 486 listing keys for "bookmarks"
487 487 3 changesets found
488 488 list of changesets:
@@ -556,7 +556,7 b' fred is allowed inside foo/, but not foo'
556 556 query 1; heads
557 557 searching for changes
558 558 all remote heads known locally
559 invalid branchheads cache (unserved): tip differs
559 invalid branchheads cache (served): tip differs
560 560 listing keys for "bookmarks"
561 561 3 changesets found
562 562 list of changesets:
@@ -627,7 +627,7 b' fred is allowed inside foo/, but not foo'
627 627 query 1; heads
628 628 searching for changes
629 629 all remote heads known locally
630 invalid branchheads cache (unserved): tip differs
630 invalid branchheads cache (served): tip differs
631 631 listing keys for "bookmarks"
632 632 3 changesets found
633 633 list of changesets:
@@ -700,7 +700,7 b' barney is allowed everywhere'
700 700 query 1; heads
701 701 searching for changes
702 702 all remote heads known locally
703 invalid branchheads cache (unserved): tip differs
703 invalid branchheads cache (served): tip differs
704 704 listing keys for "bookmarks"
705 705 3 changesets found
706 706 list of changesets:
@@ -779,7 +779,7 b' wilma can change files with a .txt exten'
779 779 query 1; heads
780 780 searching for changes
781 781 all remote heads known locally
782 invalid branchheads cache (unserved): tip differs
782 invalid branchheads cache (served): tip differs
783 783 listing keys for "bookmarks"
784 784 3 changesets found
785 785 list of changesets:
@@ -859,7 +859,7 b' file specified by acl.config does not ex'
859 859 query 1; heads
860 860 searching for changes
861 861 all remote heads known locally
862 invalid branchheads cache (unserved): tip differs
862 invalid branchheads cache (served): tip differs
863 863 listing keys for "bookmarks"
864 864 3 changesets found
865 865 list of changesets:
@@ -934,7 +934,7 b' betty is allowed inside foo/ by a acl.co'
934 934 query 1; heads
935 935 searching for changes
936 936 all remote heads known locally
937 invalid branchheads cache (unserved): tip differs
937 invalid branchheads cache (served): tip differs
938 938 listing keys for "bookmarks"
939 939 3 changesets found
940 940 list of changesets:
@@ -1020,7 +1020,7 b' acl.config can set only [acl.allow]/[acl'
1020 1020 query 1; heads
1021 1021 searching for changes
1022 1022 all remote heads known locally
1023 invalid branchheads cache (unserved): tip differs
1023 invalid branchheads cache (served): tip differs
1024 1024 listing keys for "bookmarks"
1025 1025 3 changesets found
1026 1026 list of changesets:
@@ -1100,7 +1100,7 b' fred is always allowed'
1100 1100 query 1; heads
1101 1101 searching for changes
1102 1102 all remote heads known locally
1103 invalid branchheads cache (unserved): tip differs
1103 invalid branchheads cache (served): tip differs
1104 1104 listing keys for "bookmarks"
1105 1105 3 changesets found
1106 1106 list of changesets:
@@ -1176,7 +1176,7 b' no one is allowed inside foo/Bar/'
1176 1176 query 1; heads
1177 1177 searching for changes
1178 1178 all remote heads known locally
1179 invalid branchheads cache (unserved): tip differs
1179 invalid branchheads cache (served): tip differs
1180 1180 listing keys for "bookmarks"
1181 1181 3 changesets found
1182 1182 list of changesets:
@@ -1252,7 +1252,7 b' OS-level groups'
1252 1252 query 1; heads
1253 1253 searching for changes
1254 1254 all remote heads known locally
1255 invalid branchheads cache (unserved): tip differs
1255 invalid branchheads cache (served): tip differs
1256 1256 listing keys for "bookmarks"
1257 1257 3 changesets found
1258 1258 list of changesets:
@@ -1329,7 +1329,7 b' OS-level groups'
1329 1329 query 1; heads
1330 1330 searching for changes
1331 1331 all remote heads known locally
1332 invalid branchheads cache (unserved): tip differs
1332 invalid branchheads cache (served): tip differs
1333 1333 listing keys for "bookmarks"
1334 1334 3 changesets found
1335 1335 list of changesets:
@@ -1527,7 +1527,7 b' Branch acl deny test'
1527 1527 query 1; heads
1528 1528 searching for changes
1529 1529 all remote heads known locally
1530 invalid branchheads cache (unserved): tip differs
1530 invalid branchheads cache (served): tip differs
1531 1531 listing keys for "bookmarks"
1532 1532 4 changesets found
1533 1533 list of changesets:
@@ -1839,7 +1839,7 b' push foobar into the remote'
1839 1839 query 1; heads
1840 1840 searching for changes
1841 1841 all remote heads known locally
1842 invalid branchheads cache (unserved): tip differs
1842 invalid branchheads cache (served): tip differs
1843 1843 listing keys for "bookmarks"
1844 1844 4 changesets found
1845 1845 list of changesets:
@@ -1927,7 +1927,7 b' Branch acl conflicting deny'
1927 1927 query 1; heads
1928 1928 searching for changes
1929 1929 all remote heads known locally
1930 invalid branchheads cache (unserved): tip differs
1930 invalid branchheads cache (served): tip differs
1931 1931 listing keys for "bookmarks"
1932 1932 4 changesets found
1933 1933 list of changesets:
@@ -2083,7 +2083,7 b' Non-astro users must be denied'
2083 2083 query 1; heads
2084 2084 searching for changes
2085 2085 all remote heads known locally
2086 invalid branchheads cache (unserved): tip differs
2086 invalid branchheads cache (served): tip differs
2087 2087 listing keys for "bookmarks"
2088 2088 4 changesets found
2089 2089 list of changesets:
@@ -70,7 +70,7 b' Non store repo:'
70 70 .hg/00changelog.i
71 71 .hg/00manifest.i
72 72 .hg/cache
73 .hg/cache/branchheads-unserved
73 .hg/cache/branchheads-served
74 74 .hg/data
75 75 .hg/data/tst.d.hg
76 76 .hg/data/tst.d.hg/foo.i
@@ -98,7 +98,7 b' Non fncache repo:'
98 98 .hg
99 99 .hg/00changelog.i
100 100 .hg/cache
101 .hg/cache/branchheads-unserved
101 .hg/cache/branchheads-served
102 102 .hg/dirstate
103 103 .hg/last-message.txt
104 104 .hg/requires
@@ -196,7 +196,7 b' r4 has hardlinks in the working dir (not'
196 196 $ nlinksdir r4
197 197 2 r4/.hg/00changelog.i
198 198 2 r4/.hg/branch
199 2 r4/.hg/cache/branchheads-unserved
199 2 r4/.hg/cache/branchheads-served
200 200 2 r4/.hg/dirstate
201 201 2 r4/.hg/hgrc
202 202 2 r4/.hg/last-message.txt
@@ -226,7 +226,7 b' Update back to revision 11 in r4 should '
226 226 $ nlinksdir r4
227 227 2 r4/.hg/00changelog.i
228 228 1 r4/.hg/branch
229 2 r4/.hg/cache/branchheads-unserved
229 2 r4/.hg/cache/branchheads-served
230 230 1 r4/.hg/dirstate
231 231 2 r4/.hg/hgrc
232 232 2 r4/.hg/last-message.txt
@@ -66,7 +66,7 b' new directories are setgid'
66 66 00700 ./.hg/
67 67 00600 ./.hg/00changelog.i
68 68 00770 ./.hg/cache/
69 00660 ./.hg/cache/branchheads-unserved
69 00660 ./.hg/cache/branchheads-served
70 70 00660 ./.hg/dirstate
71 71 00660 ./.hg/last-message.txt
72 72 00600 ./.hg/requires
@@ -111,7 +111,7 b' group can still write everything'
111 111 00770 ../push/.hg/
112 112 00660 ../push/.hg/00changelog.i
113 113 00770 ../push/.hg/cache/
114 00660 ../push/.hg/cache/branchheads-impactable
114 00660 ../push/.hg/cache/branchheads-base
115 115 00660 ../push/.hg/requires
116 116 00770 ../push/.hg/store/
117 117 00660 ../push/.hg/store/00changelog.i
@@ -576,7 +576,7 b' Copy and show added kwfiles'
576 576 Commit and show expansion in original and copy
577 577
578 578 $ hg --debug commit -ma2c -d '1 0' -u 'User Name <user@example.com>'
579 invalid branchheads cache (unserved): tip differs
579 invalid branchheads cache (served): tip differs
580 580 c
581 581 c: copy a:0045e12f6c5791aac80ca6cbfd97709a88307292
582 582 overwriting c expanding keywords
@@ -760,10 +760,10 b' Commit with multi-line message and custo'
760 760 | invalid here.
761 761
762 762 $ hg --debug commit -l log -d '2 0' -u 'User Name <user@example.com>'
763 invalid branchheads cache (unserved): tip differs
763 invalid branchheads cache (served): tip differs
764 764 a
765 765 invalid branchheads cache: tip differs
766 invalid branchheads cache (unserved): tip differs
766 invalid branchheads cache (served): tip differs
767 767 overwriting a expanding keywords
768 768 committed changeset 2:bb948857c743469b22bbf51f7ec8112279ca5d83
769 769 $ rm log
@@ -122,7 +122,7 b' Test for invalid branch cache:'
122 122 repository tip rolled back to revision 4 (undo commit)
123 123 working directory now based on revisions 4 and 3
124 124
125 $ cp ${branchcache}-unserved .hg/bc-invalid
125 $ cp ${branchcache}-served .hg/bc-invalid
126 126
127 127 $ hg log -r foo
128 128 changeset: 4:adf1a74a7f7b
@@ -160,7 +160,7 b' Test for invalid branch cache:'
160 160 $ listbranchcaches
161 161 === .hg/cache/branchheads ===
162 162 corrupted
163 === .hg/cache/branchheads-unserved ===
163 === .hg/cache/branchheads-served ===
164 164 adf1a74a7f7b4cd193d12992f5d0d6a004ed21d6 4
165 165 c21617b13b220988e7a2e26290fbe4325ffa7139 bar
166 166 1c28f494dae69a2f8fc815059d257eccf3fcfe75 default
@@ -175,7 +175,7 b' Pushing just rev 0:'
175 175 $ hg push -qr 0 ../target
176 176
177 177 $ (cd ../target/; listbranchcaches)
178 === .hg/cache/branchheads-impactable ===
178 === .hg/cache/branchheads-base ===
179 179 db01e8ea3388fd3c7c94e1436ea2bd6a53d581c5 0
180 180 db01e8ea3388fd3c7c94e1436ea2bd6a53d581c5 default
181 181
@@ -184,7 +184,7 b' Pushing everything:'
184 184 $ hg push -qf ../target
185 185
186 186 $ (cd ../target/; listbranchcaches)
187 === .hg/cache/branchheads-impactable ===
187 === .hg/cache/branchheads-base ===
188 188 adf1a74a7f7b4cd193d12992f5d0d6a004ed21d6 4
189 189 c21617b13b220988e7a2e26290fbe4325ffa7139 bar
190 190 1c28f494dae69a2f8fc815059d257eccf3fcfe75 default
@@ -62,7 +62,7 b' A_1 have two direct and divergent succes'
62 62 $ newcase direct
63 63 $ hg debugobsolete `getid A_0` `getid A_1`
64 64 $ hg debugobsolete `getid A_0` `getid A_2`
65 invalid branchheads cache (unserved): tip differs
65 invalid branchheads cache (served): tip differs
66 66 $ hg log -G --hidden
67 67 o 3:392fd25390da A_2
68 68 |
@@ -104,7 +104,7 b' indirect divergence with known changeset'
104 104 $ newcase indirect_known
105 105 $ hg debugobsolete `getid A_0` `getid A_1`
106 106 $ hg debugobsolete `getid A_0` `getid A_2`
107 invalid branchheads cache (unserved): tip differs
107 invalid branchheads cache (served): tip differs
108 108 $ mkcommit A_3
109 109 created new head
110 110 $ hg debugobsolete `getid A_2` `getid A_3`
@@ -143,7 +143,7 b' indirect divergence with known changeset'
143 143 $ newcase indirect_unknown
144 144 $ hg debugobsolete `getid A_0` aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
145 145 $ hg debugobsolete aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa `getid A_1`
146 invalid branchheads cache (unserved): tip differs
146 invalid branchheads cache (served): tip differs
147 147 $ hg debugobsolete `getid A_0` `getid A_2`
148 148 $ hg log -G --hidden
149 149 o 3:392fd25390da A_2
@@ -175,7 +175,7 b' do not take unknown node in account if t'
175 175 $ newcase final-unknown
176 176 $ hg debugobsolete `getid A_0` `getid A_1`
177 177 $ hg debugobsolete `getid A_1` `getid A_2`
178 invalid branchheads cache (unserved): tip differs
178 invalid branchheads cache (served): tip differs
179 179 $ hg debugobsolete `getid A_0` bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
180 180 $ hg debugobsolete bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb cccccccccccccccccccccccccccccccccccccccc
181 181 $ hg debugobsolete `getid A_1` dddddddddddddddddddddddddddddddddddddddd
@@ -192,7 +192,7 b' divergence that converge again is not di'
192 192 $ newcase converged_divergence
193 193 $ hg debugobsolete `getid A_0` `getid A_1`
194 194 $ hg debugobsolete `getid A_0` `getid A_2`
195 invalid branchheads cache (unserved): tip differs
195 invalid branchheads cache (served): tip differs
196 196 $ mkcommit A_3
197 197 created new head
198 198 $ hg debugobsolete `getid A_1` `getid A_3`
@@ -439,7 +439,7 b' successors-set. (report [A,B] not [A] + '
439 439 $ newcase subset
440 440 $ hg debugobsolete `getid A_0` `getid A_2`
441 441 $ hg debugobsolete `getid A_0` `getid A_1` `getid A_2`
442 invalid branchheads cache (unserved): tip differs
442 invalid branchheads cache (served): tip differs
443 443 $ hg debugsuccessorssets --hidden 'desc('A_0')'
444 444 007dc284c1f8
445 445 82623d38b9ba 392fd25390da
@@ -176,14 +176,14 b' visible shared between the initial repo '
176 176 check that branch cache with "unserved" filter are properly computed and stored
177 177
178 178 $ ls ../push-dest/.hg/cache/branchheads*
179 ../push-dest/.hg/cache/branchheads-hidden
180 ../push-dest/.hg/cache/branchheads-unserved
181 $ cat ../push-dest/.hg/cache/branchheads-hidden
179 ../push-dest/.hg/cache/branchheads-served
180 ../push-dest/.hg/cache/branchheads-visible
181 $ cat ../push-dest/.hg/cache/branchheads-visible
182 182 6d6770faffce199f1fddd1cf87f6f026138cf061 6
183 183 b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e default
184 184 2713879da13d6eea1ff22b442a5a87cb31a7ce6a default
185 185 6d6770faffce199f1fddd1cf87f6f026138cf061 default
186 $ cat ../push-dest/.hg/cache/branchheads-unserved
186 $ cat ../push-dest/.hg/cache/branchheads-served
187 187 cf9fe039dfd67e829edf6522a45de057b5c86519 4
188 188 b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e default
189 189 cf9fe039dfd67e829edf6522a45de057b5c86519 default
@@ -274,7 +274,7 b' also, the parent of a node that is a chi'
274 274 7:c65502d4178782309ce0574c5ae6ee9485a9bafa default
275 275 6:c772a8b2dc17629cec88a19d09c926c4814b12c7 default
276 276
277 $ cat $TESTTMP/b2/.hg/cache/branchheads-unserved
277 $ cat $TESTTMP/b2/.hg/cache/branchheads-served
278 278 c65502d4178782309ce0574c5ae6ee9485a9bafa 7
279 279 c772a8b2dc17629cec88a19d09c926c4814b12c7 default
280 280 c65502d4178782309ce0574c5ae6ee9485a9bafa default
General Comments 0
You need to be logged in to leave comments. Login now