0

I'm working on a big project, started many years ago and evolved over time. I'm going to clone its repository on my new computer, but I would like to avoid to import the whole history, as it's quite unlikely that I will ever work on very old revisions. I would like to avoid to copy all the data related to the beginning of the project history.

So, is it possible to perform a kind of "lazy clone", that is, clone only the last part of the history, let's say 6 month, and eventually get the missing parts only when needed? How?

Thanks!

Starnuto di topo
  • 3,215
  • 5
  • 32
  • 66
  • 3
    Simple answer, No:-( It's already been discussed here http://stackoverflow.com/questions/2684898/mercurial-remove-history – Magnus Mar 07 '16 at 08:58
  • Simple answer - yes, see http://stackoverflow.com/a/8819813/960558 – Lazy Badger Mar 07 '16 at 10:44
  • 2
    hg convert, which @LazyBadger points to, will give you a totally new repository (with new hashes) which have no connection with the original repository. Hence, OPs "eventually get the missing parts only when needed" wont work. – Magnus Mar 07 '16 at 13:19
  • @Magnus - one more convert with `--splicemap`... OK, pull + strip + convert – Lazy Badger Mar 07 '16 at 13:43
  • @LazyBadger interesting! Have to check that one. Thanx! – Magnus Mar 07 '16 at 14:44
  • 2
    While without conversion you cannot skip old history, for a branch-rich repository a narrow clone (only a changeset and all of its history but not the one of other heads) may be helpful – planetmaker Mar 07 '16 at 16:33
  • Old history can be also MQ-ed before pull|push into trimmed repository – Lazy Badger Mar 07 '16 at 16:45

0 Answers0