This is an archive of the discontinued Mercurial Phabricator instance.

age: add age revsetpredicate extension
ClosedPublic

Authored by mbthomas on Jul 28 2017, 1:53 PM.
Tags
None
Subscribers
None

Details

Reviewers
stash
Group Reviewers
Restricted Project
Commits
rFBHGXe3035f301441: age: add age revsetpredicate extension
Summary

Adds a new revsetpredicate: age(), which matches changesets that are
older or younger than a certain age.

Test Plan

Add new unit test for the predicate.

Diff Detail

Repository
rFBHGX Facebook Mercurial Extensions
Branch
infpush-summary (bookmark) on default (branch)
Lint
Lint OK
Unit
Unit Tests OK

Event Timeline

mbthomas created this revision.Jul 28 2017, 1:53 PM
mbthomas updated this revision to Diff 447.Jul 28 2017, 1:55 PM

Remove unnecessary lines from test.

stash edited edge metadata.EditedJul 28 2017, 4:01 PM

Why not extend date() revset? Do you want to do it because it's faster?

stash accepted this revision.Jul 31 2017, 6:06 AM

Discussed offline - @mbthomas will create a task to make the changes to upstream date revset.

@mbthomas I'm accepting the diff but please address my comments before landing.

hgext3rd/age.py
1

Let's add a comment explaining the difference from date(...).

12–19

Please remove unused imports

33

No need to use unfiltered repo

35–36

Do you think it worth compiling this regex only once?

36

I think there shouldn't be ? after s, should it?

This revision is now accepted and ready to land.Jul 31 2017, 6:06 AM
mbthomas added inline comments.Jul 31 2017, 8:54 AM
hgext3rd/age.py
36

Actually I made "seconds" the default unit, but forgot to document it. Will fix up the doc comment.

mbthomas updated this revision to Diff 450.Jul 31 2017, 10:06 AM

Rebase and apply review markups

mbthomas marked 6 inline comments as done.Jul 31 2017, 11:27 AM
mbthomas closed this revision.Aug 2 2017, 5:28 AM