def revset_me(repo, subset, x): """``me()`` Changesets that you are involved in. """ if x: raise ParseError(_('me() does not take any arguments')) me = repo.ui.config('ui', 'username') if not me: raise util.Abort(_('"[ui] username" must be set to use me()')) ircnick = get_ircnick(repo.ui) n = encoding.lower(me) kind, pattern, matcher = revset._substringmatcher(n) revs = [] for r in subset: ctx = repo[r] if matcher(encoding.lower(ctx.user())): revs.append(r) continue if ircnick in parse_reviewers(ctx.description()): revs.append(r) continue return revs
def revset_pushuser(repo, subset, x): """User name that pushed the changeset contains string. The match is case-insensitive. If `string` starts with `re:`, the remainder of the string is treated as a regular expression. To match a user that actually contains `re:`, use the prefix `literal:`. """ l = revset.getargs(x, 1, 1, 'pushuser requires one argument') n = encoding.lower(revset.getstring(l[0], 'pushuser requires a string')) kind, pattern, matcher = revset._substringmatcher(n) def getrevs(): for push in repo.pushlog.pushes(): if matcher(encoding.lower(push.user)): for node in push.nodes: yield repo[node].rev() return subset & revset.generatorset(getrevs())
def revset_pushuser(repo, subset, x): """``pushuser(string)`` User name that pushed the changeset contains string. The match is case-insensitive. If `string` starts with `re:`, the remainder of the string is treated as a regular expression. To match a user that actually contains `re:`, use the prefix `literal:`. """ l = revset.getargs(x, 1, 1, 'pushuser requires one argument') n = encoding.lower(revset.getstring(l[0], 'pushuser requires a string')) kind, pattern, matcher = revset._substringmatcher(n) def getrevs(): for pushid, who, when, nodes in repo.pushlog.pushes(): if matcher(encoding.lower(who)): for node in nodes: yield repo[node].rev() return subset & revset.generatorset(getrevs())
def revset_me(repo, subset, x): """Changesets that you are involved in.""" if x: raise ParseError(_('me() does not take any arguments')) me = repo.ui.config('ui', 'username') if not me: raise error.Abort(_('"[ui] username" must be set to use me()')) ircnick = get_ircnick(repo.ui) n = encoding.lower(me) kind, pattern, matcher = revset._substringmatcher(n) def fltr(x): ctx = repo[x] if matcher(encoding.lower(ctx.user())): return True return ircnick in parse_reviewers(ctx.description()) return subset.filter(fltr)