##// END OF EJS Templates
clfilter: add mutable filtering...
Pierre-Yves David -
r18245:aff706b3 default
parent child Browse files
Show More
@@ -8,6 +8,7 b''
8
8
9 import copy
9 import copy
10 import phases
10 import phases
11 import util
11
12
12
13
13 def computehidden(repo):
14 def computehidden(repo):
@@ -29,9 +30,20 b' def computeunserved(repo):'
29 return frozenset(repo.revs('hidden() + secret()'))
30 return frozenset(repo.revs('hidden() + secret()'))
30 return frozenset()
31 return frozenset()
31
32
33 def computemutable(repo):
34 """compute the set of revision that should be filtered when used a server
35
36 Secret and hidden changeset should not pretend to be here."""
37 assert not repo.changelog.filteredrevs
38 # fast check to avoid revset call on huge repo
39 if util.any(repo._phasecache.phaseroots[1:]):
40 return frozenset(repo.revs('draft() + secret()'))
41 return frozenset()
42
32 # function to compute filtered set
43 # function to compute filtered set
33 filtertable = {'hidden': computehidden,
44 filtertable = {'hidden': computehidden,
34 'unserved': computeunserved}
45 'unserved': computeunserved,
46 'mutable': computemutable}
35 ### Nearest subset relation
47 ### Nearest subset relation
36 # Nearest subset of filter X is a filter Y so that:
48 # Nearest subset of filter X is a filter Y so that:
37 # * Y is included in X,
49 # * Y is included in X,
@@ -39,7 +51,8 b" filtertable = {'hidden': computehidden,"
39 # This create and ordering used for branchmap purpose.
51 # This create and ordering used for branchmap purpose.
40 # the ordering may be partial
52 # the ordering may be partial
41 subsettable = {None: 'hidden',
53 subsettable = {None: 'hidden',
42 'hidden': 'unserved'}
54 'hidden': 'unserved',
55 'unserved': 'mutable'}
43
56
44 def filteredrevs(repo, filtername):
57 def filteredrevs(repo, filtername):
45 """returns set of filtered revision for this filter name"""
58 """returns set of filtered revision for this filter name"""
@@ -341,6 +341,7 b' fred is allowed inside foo/'
341 query 1; heads
341 query 1; heads
342 searching for changes
342 searching for changes
343 all remote heads known locally
343 all remote heads known locally
344 invalid branchheads cache (unserved): tip differs
344 listing keys for "bookmarks"
345 listing keys for "bookmarks"
345 3 changesets found
346 3 changesets found
346 list of changesets:
347 list of changesets:
@@ -412,6 +413,7 b' Empty [acl.deny]'
412 query 1; heads
413 query 1; heads
413 searching for changes
414 searching for changes
414 all remote heads known locally
415 all remote heads known locally
416 invalid branchheads cache (unserved): tip differs
415 listing keys for "bookmarks"
417 listing keys for "bookmarks"
416 3 changesets found
418 3 changesets found
417 list of changesets:
419 list of changesets:
@@ -480,6 +482,7 b' fred is allowed inside foo/, but not foo'
480 query 1; heads
482 query 1; heads
481 searching for changes
483 searching for changes
482 all remote heads known locally
484 all remote heads known locally
485 invalid branchheads cache (unserved): tip differs
483 listing keys for "bookmarks"
486 listing keys for "bookmarks"
484 3 changesets found
487 3 changesets found
485 list of changesets:
488 list of changesets:
@@ -553,6 +556,7 b' fred is allowed inside foo/, but not foo'
553 query 1; heads
556 query 1; heads
554 searching for changes
557 searching for changes
555 all remote heads known locally
558 all remote heads known locally
559 invalid branchheads cache (unserved): tip differs
556 listing keys for "bookmarks"
560 listing keys for "bookmarks"
557 3 changesets found
561 3 changesets found
558 list of changesets:
562 list of changesets:
@@ -623,6 +627,7 b' fred is allowed inside foo/, but not foo'
623 query 1; heads
627 query 1; heads
624 searching for changes
628 searching for changes
625 all remote heads known locally
629 all remote heads known locally
630 invalid branchheads cache (unserved): tip differs
626 listing keys for "bookmarks"
631 listing keys for "bookmarks"
627 3 changesets found
632 3 changesets found
628 list of changesets:
633 list of changesets:
@@ -695,6 +700,7 b' barney is allowed everywhere'
695 query 1; heads
700 query 1; heads
696 searching for changes
701 searching for changes
697 all remote heads known locally
702 all remote heads known locally
703 invalid branchheads cache (unserved): tip differs
698 listing keys for "bookmarks"
704 listing keys for "bookmarks"
699 3 changesets found
705 3 changesets found
700 list of changesets:
706 list of changesets:
@@ -853,6 +859,7 b' file specified by acl.config does not ex'
853 query 1; heads
859 query 1; heads
854 searching for changes
860 searching for changes
855 all remote heads known locally
861 all remote heads known locally
862 invalid branchheads cache (unserved): tip differs
856 listing keys for "bookmarks"
863 listing keys for "bookmarks"
857 3 changesets found
864 3 changesets found
858 list of changesets:
865 list of changesets:
@@ -927,6 +934,7 b' betty is allowed inside foo/ by a acl.co'
927 query 1; heads
934 query 1; heads
928 searching for changes
935 searching for changes
929 all remote heads known locally
936 all remote heads known locally
937 invalid branchheads cache (unserved): tip differs
930 listing keys for "bookmarks"
938 listing keys for "bookmarks"
931 3 changesets found
939 3 changesets found
932 list of changesets:
940 list of changesets:
@@ -1012,6 +1020,7 b' acl.config can set only [acl.allow]/[acl'
1012 query 1; heads
1020 query 1; heads
1013 searching for changes
1021 searching for changes
1014 all remote heads known locally
1022 all remote heads known locally
1023 invalid branchheads cache (unserved): tip differs
1015 listing keys for "bookmarks"
1024 listing keys for "bookmarks"
1016 3 changesets found
1025 3 changesets found
1017 list of changesets:
1026 list of changesets:
@@ -1243,6 +1252,7 b' OS-level groups'
1243 query 1; heads
1252 query 1; heads
1244 searching for changes
1253 searching for changes
1245 all remote heads known locally
1254 all remote heads known locally
1255 invalid branchheads cache (unserved): tip differs
1246 listing keys for "bookmarks"
1256 listing keys for "bookmarks"
1247 3 changesets found
1257 3 changesets found
1248 list of changesets:
1258 list of changesets:
@@ -111,7 +111,7 b' group can still write everything'
111 00770 ../push/.hg/
111 00770 ../push/.hg/
112 00660 ../push/.hg/00changelog.i
112 00660 ../push/.hg/00changelog.i
113 00770 ../push/.hg/cache/
113 00770 ../push/.hg/cache/
114 00660 ../push/.hg/cache/branchheads-unserved
114 00660 ../push/.hg/cache/branchheads-mutable
115 00660 ../push/.hg/requires
115 00660 ../push/.hg/requires
116 00770 ../push/.hg/store/
116 00770 ../push/.hg/store/
117 00660 ../push/.hg/store/00changelog.i
117 00660 ../push/.hg/store/00changelog.i
@@ -748,8 +748,10 b' Commit with multi-line message and custo'
748
748
749 $ hg --debug commit -l log -d '2 0' -u 'User Name <user@example.com>'
749 $ hg --debug commit -l log -d '2 0' -u 'User Name <user@example.com>'
750 invalid branchheads cache: tip differs
750 invalid branchheads cache: tip differs
751 invalid branchheads cache (unserved): tip differs
751 a
752 a
752 invalid branchheads cache: tip differs
753 invalid branchheads cache: tip differs
754 invalid branchheads cache (unserved): tip differs
753 overwriting a expanding keywords
755 overwriting a expanding keywords
754 committed changeset 2:bb948857c743469b22bbf51f7ec8112279ca5d83
756 committed changeset 2:bb948857c743469b22bbf51f7ec8112279ca5d83
755 $ rm log
757 $ rm log
@@ -176,7 +176,7 b' Pushing just rev 0:'
176 $ hg push -qr 0 ../target
176 $ hg push -qr 0 ../target
177
177
178 $ (cd ../target/; listbranchcaches)
178 $ (cd ../target/; listbranchcaches)
179 === .hg/cache/branchheads-unserved ===
179 === .hg/cache/branchheads-mutable ===
180 db01e8ea3388fd3c7c94e1436ea2bd6a53d581c5 0
180 db01e8ea3388fd3c7c94e1436ea2bd6a53d581c5 0
181 db01e8ea3388fd3c7c94e1436ea2bd6a53d581c5 default
181 db01e8ea3388fd3c7c94e1436ea2bd6a53d581c5 default
182
182
@@ -185,7 +185,7 b' Pushing everything:'
185 $ hg push -qf ../target
185 $ hg push -qf ../target
186
186
187 $ (cd ../target/; listbranchcaches)
187 $ (cd ../target/; listbranchcaches)
188 === .hg/cache/branchheads-unserved ===
188 === .hg/cache/branchheads-mutable ===
189 adf1a74a7f7b4cd193d12992f5d0d6a004ed21d6 4
189 adf1a74a7f7b4cd193d12992f5d0d6a004ed21d6 4
190 1c28f494dae69a2f8fc815059d257eccf3fcfe75 default
190 1c28f494dae69a2f8fc815059d257eccf3fcfe75 default
191 adf1a74a7f7b4cd193d12992f5d0d6a004ed21d6 foo
191 adf1a74a7f7b4cd193d12992f5d0d6a004ed21d6 foo
General Comments 0
You need to be logged in to leave comments. Login now