Tim Ruddick
Tim Ruddick

Reputation: 1413

In Mercurial, how can I see revisions pushed to a repo in the last 24 hours?

I have a Mercurial repository that several people push to from their own, local repositories. I'd like to be able to query this central repository for all changes that arrived at that repository in the last 24 hours, notably not just changes that were committed in the last 24 hours.

The hg log --date option doesn't do what I need. It only refines the selection based on the date of commit. So, hg log --date -1 gets me revisions committed since yesterday, but not revisions committed, say, three days ago, but only pushed to this repo today.

If I can find the revision number (or id) of the oldest revision arriving at the repo less than 24 hours ago, that would do the trick; but I can't see anything — even in hg help revsets — that looks like it'll work.

Upvotes: 11

Views: 2930

Answers (2)

Lasse V. Karlsen
Lasse V. Karlsen

Reputation: 391674

You can use pushlog, an extension to Mercurial that you configure server-side.

Basically you install the requisite files, and configure your server repository hooks to call into pushlog on each push, and then the script will log whenever someone pushes to that repository.

Unfortunately I don't know more about it than what's on that page, I asked on the IRC channel of Mercurial and got that name there.

You can see an example of the log here: calc pushlog.

Additionally, there are web systems you can use that contains such logs. Here's what my Kiln log looks like after todays changes.

Kiln activity log

Upvotes: 10

jakebasile
jakebasile

Reputation: 8132

I don't know of a built in method to do this, but you could get that information in a roundabout way. Write a script to clone your main repo each day, and name it accordingly; say project1-2011-4-31, project1-2011-5-1\. Then it's a simple matter of seeing what is incoming from one to the other:

cd %projectdirectory%\dateclones
cd project1-2011-3-25
hg incoming ..\project1-2011-5-1

Would give you all changes pushed between when project1-2011-3-25 was cloned and project1-2011-5-1 was cloned.

Upvotes: 1

Related Questions