Show More
@@ -628,12 +628,22 b' def revrange(repo, revs):' | |||||
628 | return repo[val].rev() |
|
628 | return repo[val].rev() | |
629 |
|
629 | |||
630 | seen, l = set(), revset.baseset([]) |
|
630 | seen, l = set(), revset.baseset([]) | |
|
631 | ||||
|
632 | revsetaliases = [alias for (alias, _) in | |||
|
633 | repo.ui.configitems("revsetalias")] | |||
|
634 | ||||
631 | for spec in revs: |
|
635 | for spec in revs: | |
632 | if l and not seen: |
|
636 | if l and not seen: | |
633 | seen = set(l) |
|
637 | seen = set(l) | |
634 | # attempt to parse old-style ranges first to deal with |
|
638 | # attempt to parse old-style ranges first to deal with | |
635 | # things like old-tag which contain query metacharacters |
|
639 | # things like old-tag which contain query metacharacters | |
636 | try: |
|
640 | try: | |
|
641 | # ... except for revset aliases without arguments. These | |||
|
642 | # should be parsed as soon as possible, because they might | |||
|
643 | # clash with a hash prefix. | |||
|
644 | if spec in revsetaliases: | |||
|
645 | raise error.RepoLookupError | |||
|
646 | ||||
637 | if isinstance(spec, int): |
|
647 | if isinstance(spec, int): | |
638 | seen.add(spec) |
|
648 | seen.add(spec) | |
639 | l = l + revset.baseset([spec]) |
|
649 | l = l + revset.baseset([spec]) | |
@@ -641,6 +651,9 b' def revrange(repo, revs):' | |||||
641 |
|
651 | |||
642 | if _revrangesep in spec: |
|
652 | if _revrangesep in spec: | |
643 | start, end = spec.split(_revrangesep, 1) |
|
653 | start, end = spec.split(_revrangesep, 1) | |
|
654 | if start in revsetaliases or end in revsetaliases: | |||
|
655 | raise error.RepoLookupError | |||
|
656 | ||||
644 | start = revfix(repo, start, 0) |
|
657 | start = revfix(repo, start, 0) | |
645 | end = revfix(repo, end, len(repo) - 1) |
|
658 | end = revfix(repo, end, len(repo) - 1) | |
646 | if end == nullrev and start < 0: |
|
659 | if end == nullrev and start < 0: |
@@ -1127,6 +1127,62 b' far away.' | |||||
1127 | 3 |
|
1127 | 3 | |
1128 | 2 |
|
1128 | 2 | |
1129 |
|
1129 | |||
|
1130 | issue4553: check that revset aliases override existing hash prefix | |||
|
1131 | ||||
|
1132 | $ hg log -qr e | |||
|
1133 | 6:e0cc66ef77e8 | |||
|
1134 | ||||
|
1135 | $ hg log -qr e --config revsetalias.e="all()" | |||
|
1136 | 0:2785f51eece5 | |||
|
1137 | 1:d75937da8da0 | |||
|
1138 | 2:5ed5505e9f1c | |||
|
1139 | 3:8528aa5637f2 | |||
|
1140 | 4:2326846efdab | |||
|
1141 | 5:904fa392b941 | |||
|
1142 | 6:e0cc66ef77e8 | |||
|
1143 | 7:013af1973af4 | |||
|
1144 | 8:d5d0dcbdc4d9 | |||
|
1145 | 9:24286f4ae135 | |||
|
1146 | ||||
|
1147 | $ hg log -qr e: --config revsetalias.e="0" | |||
|
1148 | 0:2785f51eece5 | |||
|
1149 | 1:d75937da8da0 | |||
|
1150 | 2:5ed5505e9f1c | |||
|
1151 | 3:8528aa5637f2 | |||
|
1152 | 4:2326846efdab | |||
|
1153 | 5:904fa392b941 | |||
|
1154 | 6:e0cc66ef77e8 | |||
|
1155 | 7:013af1973af4 | |||
|
1156 | 8:d5d0dcbdc4d9 | |||
|
1157 | 9:24286f4ae135 | |||
|
1158 | ||||
|
1159 | $ hg log -qr :e --config revsetalias.e="9" | |||
|
1160 | 0:2785f51eece5 | |||
|
1161 | 1:d75937da8da0 | |||
|
1162 | 2:5ed5505e9f1c | |||
|
1163 | 3:8528aa5637f2 | |||
|
1164 | 4:2326846efdab | |||
|
1165 | 5:904fa392b941 | |||
|
1166 | 6:e0cc66ef77e8 | |||
|
1167 | 7:013af1973af4 | |||
|
1168 | 8:d5d0dcbdc4d9 | |||
|
1169 | 9:24286f4ae135 | |||
|
1170 | ||||
|
1171 | $ hg log -qr e: | |||
|
1172 | 6:e0cc66ef77e8 | |||
|
1173 | 7:013af1973af4 | |||
|
1174 | 8:d5d0dcbdc4d9 | |||
|
1175 | 9:24286f4ae135 | |||
|
1176 | ||||
|
1177 | $ hg log -qr :e | |||
|
1178 | 0:2785f51eece5 | |||
|
1179 | 1:d75937da8da0 | |||
|
1180 | 2:5ed5505e9f1c | |||
|
1181 | 3:8528aa5637f2 | |||
|
1182 | 4:2326846efdab | |||
|
1183 | 5:904fa392b941 | |||
|
1184 | 6:e0cc66ef77e8 | |||
|
1185 | ||||
1130 | issue2549 - correct optimizations |
|
1186 | issue2549 - correct optimizations | |
1131 |
|
1187 | |||
1132 | $ log 'limit(1 or 2 or 3, 2) and not 2' |
|
1188 | $ log 'limit(1 or 2 or 3, 2) and not 2' |
General Comments 0
You need to be logged in to leave comments.
Login now