Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/hgweb/webcommands.py @ 25251:235f6490550c
revset: move validation of incomplete parsing to parse() function
revset.parse() should be responsible for all parsing errors. Perhaps it wasn't
because 'revset.parse' was not a real function when the validation code was
added at ffcb7e4d719f.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sun, 26 Apr 2015 19:42:47 +0900 |
parents | 3f0744eeaeaf |
children | 85fb416f2fa7 |
comparison
equal
deleted
inserted
replaced
25250:f9a29dc964a3 | 25251:235f6490550c |
---|---|
221 else: | 221 else: |
222 return MODE_REVISION, ctx | 222 return MODE_REVISION, ctx |
223 | 223 |
224 revdef = 'reverse(%s)' % query | 224 revdef = 'reverse(%s)' % query |
225 try: | 225 try: |
226 tree, pos = revset.parse(revdef) | 226 tree = revset.parse(revdef) |
227 except ParseError: | 227 except ParseError: |
228 # can't parse to a revset tree | 228 # can't parse to a revset tree |
229 return MODE_KEYWORD, query | 229 return MODE_KEYWORD, query |
230 | 230 |
231 if revset.depth(tree) <= 2: | 231 if revset.depth(tree) <= 2: |