Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

mercurial

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.

like image 726
Tim Ruddick Avatar asked May 01 '11 20:05

Tim Ruddick


2 Answers

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

like image 164
Lasse V. Karlsen Avatar answered Oct 05 '22 05:10

Lasse V. Karlsen


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.

like image 32
jakebasile Avatar answered Oct 05 '22 05:10

jakebasile