comparison mercurial/revset.py @ 17171:9c750c3e4fac

obsolete: compute unstable changeset An unstable changeset is a changeset *not* obsolete but with some obsolete ancestors. The current logic to decide if a changeset is unstable is naive and very inefficient. A better solution is to compute the set of unstable changeset with a simple revset and to cache the result. But this require cache invalidation logic. Simpler version goes first.
author Pierre-Yves David <pierre-yves.david@logilab.fr>
date Fri, 06 Jul 2012 00:18:09 +0200
parents 63a4a3871607
children c621f84dbb35
comparison
equal deleted inserted replaced
17170:63a4a3871607 17171:9c750c3e4fac
1315 return [r for r in subset if r in s] 1315 return [r for r in subset if r in s]
1316 1316
1317 def tagged(repo, subset, x): 1317 def tagged(repo, subset, x):
1318 return tag(repo, subset, x) 1318 return tag(repo, subset, x)
1319 1319
1320 def unstable(repo, subset, x):
1321 """``unstable()``
1322 Unstable changesets are non-obsolete with obsolete descendants."""
1323 getargs(x, 0, 0, _("obsolete takes no arguments"))
1324 unstableset = set(repo.revs('(obsolete()::) - obsolete()'))
1325 return [r for r in subset if r in unstableset]
1326
1327
1320 def user(repo, subset, x): 1328 def user(repo, subset, x):
1321 """``user(string)`` 1329 """``user(string)``
1322 User name contains string. The match is case-insensitive. 1330 User name contains string. The match is case-insensitive.
1323 1331
1324 If `string` starts with `re:`, the remainder of the string is treated as 1332 If `string` starts with `re:`, the remainder of the string is treated as
1391 "secret": secret, 1399 "secret": secret,
1392 "matching": matching, 1400 "matching": matching,
1393 "tag": tag, 1401 "tag": tag,
1394 "tagged": tagged, 1402 "tagged": tagged,
1395 "user": user, 1403 "user": user,
1404 "unstable": unstable,
1396 "_list": _list, 1405 "_list": _list,
1397 } 1406 }
1398 1407
1399 methods = { 1408 methods = {
1400 "range": rangeset, 1409 "range": rangeset,