hg bundle date range

Marcin Kasperski Marcin.Kasperski at mekk.waw.pl
Tue May 4 19:08:16 UTC 2021


> 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

Explanation:

   hg log -r 'date(-30)'

prints all changesets from last 30 days.

   hg log -r 'not date(-30)'

prints all older than 30 days.

-T asks hg to use your template instead of default, so 

  hg log -r 'not date(-30)' -T '--base {node} '

prints sth like

  --base a0aecefa17278a049926b1f4c74f377892fac781 --base
    3e4c2fef7c1ed35c9b0f94e60a196327c21c85d9 …

then you execute

   hg bundle …allthose--base…  out.bundle

This is a bit exaggerated as it adds --base for whole history,
depending on repo layout this can mayhaps be reduced by some
additional criteria, up to
   hg log -r 'last(not date(-30))'
if your history is linear and it's safe to base on last
older commit…



More information about the Mercurial mailing list