##// END OF EJS Templates
revset: move order constants from revsetlang...
Yuya Nishihara -
r34018:96f249dc default
parent child Browse files
Show More
@@ -40,16 +40,53 getrange = revsetlang.getrange
40 getargs = revsetlang.getargs
40 getargs = revsetlang.getargs
41 getargsdict = revsetlang.getargsdict
41 getargsdict = revsetlang.getargsdict
42
42
43 # constants used as an argument of match() and matchany()
44 anyorder = revsetlang.anyorder
45 defineorder = revsetlang.defineorder
46 followorder = revsetlang.followorder
47
48 baseset = smartset.baseset
43 baseset = smartset.baseset
49 generatorset = smartset.generatorset
44 generatorset = smartset.generatorset
50 spanset = smartset.spanset
45 spanset = smartset.spanset
51 fullreposet = smartset.fullreposet
46 fullreposet = smartset.fullreposet
52
47
48 # Constants for ordering requirement, used in getset():
49 #
50 # If 'define', any nested functions and operations MAY change the ordering of
51 # the entries in the set (but if changes the ordering, it MUST ALWAYS change
52 # it). If 'follow', any nested functions and operations MUST take the ordering
53 # specified by the first operand to the '&' operator.
54 #
55 # For instance,
56 #
57 # X & (Y | Z)
58 # ^ ^^^^^^^
59 # | follow
60 # define
61 #
62 # will be evaluated as 'or(y(x()), z(x()))', where 'x()' can change the order
63 # of the entries in the set, but 'y()', 'z()' and 'or()' shouldn't.
64 #
65 # 'any' means the order doesn't matter. For instance,
66 #
67 # (X & Y) | ancestors(Z)
68 # ^ ^
69 # any any
70 #
71 # For 'X & Y', 'X' decides order so the order of 'Y' does not matter. For
72 # 'ancestors(Z)', Z's order does not matter since 'ancestors' does not care
73 # about the order of its argument.
74 #
75 # Currently, most revsets do not care about the order, so 'define' is
76 # equivalent to 'follow' for them, and the resulting order is based on the
77 # 'subset' parameter passed down to them:
78 #
79 # m = revset.match(..., order=defineorder)
80 # m(repo, subset)
81 # ^^^^^^
82 # For most revsets, 'define' means using the order this subset provides
83 #
84 # There are a few revsets that always redefine the order if 'define' is
85 # specified: 'sort(X)', 'reverse(X)', 'x:y'.
86 anyorder = 'any' # don't care the order, could be even random-shuffled
87 defineorder = 'define' # ALWAYS redefine, or ALWAYS follow the current order
88 followorder = 'follow' # MUST follow the current order
89
53 # helpers
90 # helpers
54
91
55 def getset(repo, subset, x, order=defineorder):
92 def getset(repo, subset, x, order=defineorder):
@@ -258,48 +258,6 def _matchnamedfunc(x, funcname):
258 return
258 return
259 return x[2]
259 return x[2]
260
260
261 # Constants for ordering requirement, used in getset():
262 #
263 # If 'define', any nested functions and operations MAY change the ordering of
264 # the entries in the set (but if changes the ordering, it MUST ALWAYS change
265 # it). If 'follow', any nested functions and operations MUST take the ordering
266 # specified by the first operand to the '&' operator.
267 #
268 # For instance,
269 #
270 # X & (Y | Z)
271 # ^ ^^^^^^^
272 # | follow
273 # define
274 #
275 # will be evaluated as 'or(y(x()), z(x()))', where 'x()' can change the order
276 # of the entries in the set, but 'y()', 'z()' and 'or()' shouldn't.
277 #
278 # 'any' means the order doesn't matter. For instance,
279 #
280 # (X & Y) | ancestors(Z)
281 # ^ ^
282 # any any
283 #
284 # For 'X & Y', 'X' decides order so the order of 'Y' does not matter. For
285 # 'ancestors(Z)', Z's order does not matter since 'ancestors' does not care
286 # about the order of its argument.
287 #
288 # Currently, most revsets do not care about the order, so 'define' is
289 # equivalent to 'follow' for them, and the resulting order is based on the
290 # 'subset' parameter passed down to them:
291 #
292 # m = revset.match(..., order=defineorder)
293 # m(repo, subset)
294 # ^^^^^^
295 # For most revsets, 'define' means using the order this subset provides
296 #
297 # There are a few revsets that always redefine the order if 'define' is
298 # specified: 'sort(X)', 'reverse(X)', 'x:y'.
299 anyorder = 'any' # don't care the order, could be even random-shuffled
300 defineorder = 'define' # ALWAYS redefine, or ALWAYS follow the current order
301 followorder = 'follow' # MUST follow the current order
302
303 def _matchonly(revs, bases):
261 def _matchonly(revs, bases):
304 """
262 """
305 >>> f = lambda *args: _matchonly(*map(parse, args))
263 >>> f = lambda *args: _matchonly(*map(parse, args))
General Comments 0
You need to be logged in to leave comments. Login now