hg bundle date range

Pierre-Yves David pierre-yves.david at ens-lyon.org
Fri May 7 05:55:43 UTC 2021



On 5/4/21 9:08 PM, Marcin Kasperski wrote:
>> Does the bundle command provide an ability to specify date
>> range to bundle? For example, bundle all commits in the last 30 days or all commits since 2021-02-30 to now?
> 
> Not. But you can workaround that by light scripting..
> 
> I would try sth like
> 
>    hg bundle $(hg log -r 'not date(-30)' -T '--base {node} ') out.bundle

Actually, you can use the argument you used for log directly in `hg 
bundle`. So you could use something like:

$ hg bundle --rev 'descendants(date(-30))' --base 'not 
descendants(date(-30))' out.bundle

The main issue with this approach is that "date" are somewhat 
unreliable. People can have drifting clock, and history edition 
operation that result in out-of-order operation. This is why I used 
`descendants(date(-30))` instead of simply `descendants(date(-30))`. It 
would catch "older" changeset that are descendant of 30 days one.

If you are always running the command in the same repository, you could 
also keep track of the previous sent changeset and reuse that as the base.

Can you share a bit more about your setup and workflow here ?

Cheers,

--
Pierre-Yves David



More information about the Mercurial mailing list