hg log - how to display a date range of revisions in reverse order?

4.2k views Asked by At

In bash, I am using a date range to restrict the number of revisions showed as follows:

hg log -d "yyyy-mm-dd to yyyy-mm-dd"

I would like to output to display the most recent revision at the bottom. Currently, it starts with the most recent at the top & works it's way down.

Thanks in advance!


I am trying to implement the hg log -r "(date("$startdate to $enddate"))" solution into a bash script as per below:

read -p "Specify start of date range(yyyy-mm-dd): " startdate
read -p "Specify end of date range(yyyy-mm-dd): " enddate
hg log -r '(date("$startdate to $enddate"))'

However, the variables are no longer recognised. I have tried using double quotes & also quoting the variables themselves but no avail. Any help is appreciated!

1

There are 1 answers

3
zerkms On BEST ANSWER

You could use revsets instead:

hg log -r 'reverse(date("yyyy-mm-dd to yyyy-mm-dd"))'