Show More
@@ -384,30 +384,6 b' def author(repo, subset, x):' | |||||
384 | kind, pattern, matcher = _substringmatcher(n) |
|
384 | kind, pattern, matcher = _substringmatcher(n) | |
385 | return subset.filter(lambda x: matcher(encoding.lower(repo[x].user()))) |
|
385 | return subset.filter(lambda x: matcher(encoding.lower(repo[x].user()))) | |
386 |
|
386 | |||
387 | def only(repo, subset, x): |
|
|||
388 | """``only(set, [set])`` |
|
|||
389 | Changesets that are ancestors of the first set that are not ancestors |
|
|||
390 | of any other head in the repo. If a second set is specified, the result |
|
|||
391 | is ancestors of the first set that are not ancestors of the second set |
|
|||
392 | (i.e. ::<set1> - ::<set2>). |
|
|||
393 | """ |
|
|||
394 | cl = repo.changelog |
|
|||
395 | # i18n: "only" is a keyword |
|
|||
396 | args = getargs(x, 1, 2, _('only takes one or two arguments')) |
|
|||
397 | include = getset(repo, spanset(repo), args[0]) |
|
|||
398 | if len(args) == 1: |
|
|||
399 | if not include: |
|
|||
400 | return baseset() |
|
|||
401 |
|
||||
402 | descendants = set(_revdescendants(repo, include, False)) |
|
|||
403 | exclude = [rev for rev in cl.headrevs() |
|
|||
404 | if not rev in descendants and not rev in include] |
|
|||
405 | else: |
|
|||
406 | exclude = getset(repo, spanset(repo), args[1]) |
|
|||
407 |
|
||||
408 | results = set(cl.findmissingrevs(common=exclude, heads=include)) |
|
|||
409 | return subset & results |
|
|||
410 |
|
||||
411 | def bisect(repo, subset, x): |
|
387 | def bisect(repo, subset, x): | |
412 | """``bisect(string)`` |
|
388 | """``bisect(string)`` | |
413 | Changesets marked in the specified bisect status: |
|
389 | Changesets marked in the specified bisect status: | |
@@ -1138,6 +1114,30 b' def obsolete(repo, subset, x):' | |||||
1138 | obsoletes = obsmod.getrevs(repo, 'obsolete') |
|
1114 | obsoletes = obsmod.getrevs(repo, 'obsolete') | |
1139 | return subset & obsoletes |
|
1115 | return subset & obsoletes | |
1140 |
|
1116 | |||
|
1117 | def only(repo, subset, x): | |||
|
1118 | """``only(set, [set])`` | |||
|
1119 | Changesets that are ancestors of the first set that are not ancestors | |||
|
1120 | of any other head in the repo. If a second set is specified, the result | |||
|
1121 | is ancestors of the first set that are not ancestors of the second set | |||
|
1122 | (i.e. ::<set1> - ::<set2>). | |||
|
1123 | """ | |||
|
1124 | cl = repo.changelog | |||
|
1125 | # i18n: "only" is a keyword | |||
|
1126 | args = getargs(x, 1, 2, _('only takes one or two arguments')) | |||
|
1127 | include = getset(repo, spanset(repo), args[0]) | |||
|
1128 | if len(args) == 1: | |||
|
1129 | if not include: | |||
|
1130 | return baseset() | |||
|
1131 | ||||
|
1132 | descendants = set(_revdescendants(repo, include, False)) | |||
|
1133 | exclude = [rev for rev in cl.headrevs() | |||
|
1134 | if not rev in descendants and not rev in include] | |||
|
1135 | else: | |||
|
1136 | exclude = getset(repo, spanset(repo), args[1]) | |||
|
1137 | ||||
|
1138 | results = set(cl.findmissingrevs(common=exclude, heads=include)) | |||
|
1139 | return subset & results | |||
|
1140 | ||||
1141 | def origin(repo, subset, x): |
|
1141 | def origin(repo, subset, x): | |
1142 | """``origin([set])`` |
|
1142 | """``origin([set])`` | |
1143 | Changesets that were specified as a source for the grafts, transplants or |
|
1143 | Changesets that were specified as a source for the grafts, transplants or | |
@@ -1687,7 +1687,6 b' symbols = {' | |||||
1687 | "ancestors": ancestors, |
|
1687 | "ancestors": ancestors, | |
1688 | "_firstancestors": _firstancestors, |
|
1688 | "_firstancestors": _firstancestors, | |
1689 | "author": author, |
|
1689 | "author": author, | |
1690 | "only": only, |
|
|||
1691 | "bisect": bisect, |
|
1690 | "bisect": bisect, | |
1692 | "bisected": bisected, |
|
1691 | "bisected": bisected, | |
1693 | "bookmark": bookmark, |
|
1692 | "bookmark": bookmark, | |
@@ -1727,6 +1726,7 b' symbols = {' | |||||
1727 | "min": minrev, |
|
1726 | "min": minrev, | |
1728 | "modifies": modifies, |
|
1727 | "modifies": modifies, | |
1729 | "obsolete": obsolete, |
|
1728 | "obsolete": obsolete, | |
|
1729 | "only": only, | |||
1730 | "origin": origin, |
|
1730 | "origin": origin, | |
1731 | "outgoing": outgoing, |
|
1731 | "outgoing": outgoing, | |
1732 | "p1": p1, |
|
1732 | "p1": p1, |
General Comments 0
You need to be logged in to leave comments.
Login now