简体   繁体   中英

How to clone from a specific revision to the last one using Mercurial?

In Mercurial , How to clone from a specific revision to the last one using ?
For example repo A have one line history from changeset 0 to changeset 100. and I want to clone A to my local repo from changeset 90 to last one (100).

Looking through the help, I noticed the -r flag but that only clone 1 specific changeset. And if there is no way to do it can somebody explain why its not implemented ? its considered a bad thing to do ?

Thanks.

You can't.

The current state of the project is all changesets from the beginning of time up until the specific changeset, you cannot prune older changesets without rewriting the history of the repository to permanently get rid of them. This will also make the repository incompatible with the original that contains the old history.

In short, you will have to do one of the following:

  1. Prune the old history, permanently getting rid of it, which will make it impossible to push/pull with original clones that still has that history
  2. Live with the history

The parameters to the clone command that specifies revsets thus only allow you to set an upper limit. This may allow you to avoid whole branches, if they aren't merged into the branch you end up cloning, but the clone command will always clone everything from the beginning of time.

For every changeset you clone, every predecessor will be cloned as well, and this cannot be avoided.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM