Note that there are some explanatory texts on larger screens.

plurals
  1. POMaintaining a one month history when using mercurial as a smart local cache for subversion
    text
    copied!<p>There are similar questions here and <a href="https://stackoverflow.com/questions/826938/interoperation-between-mercurial-and-subversion">here</a>, however they are not the same, as they are asking about using mercurial and subversion together in a general sense.</p> <p>Reading through the <a href="https://www.mercurial-scm.org/wiki/WorkingWithSubversion" rel="nofollow noreferrer">Mercurial and Subversion page</a>, there are four options, hgsubversion, mq, convert and hgsvn. hgsubversion and convert both require a full local copy of the repository, and my repository is massively large (10+ gigs), mostly in binary checkins that are not useful to me, so I am not keen on this option. mq on the other hand doesn't allow any offline history searching, and so defeats one of the main reasons for wanting to use mercurial.</p> <p>This narrows the options down to using hgsvn. I have installed this and am playing with it, and it seems to do most of what I want. For various reasons, mostly to do with disk space, I don't really care about the history from more than six months back, so I would like to be able to keep only six months of history. However when you use hgimportsvn to set up your copy of the svn tree, you set the initial repository to import, and there is no way (using hgsvn) to remove those initial revisions when they move out of the six month window.</p> <p>Looking at <a href="https://www.mercurial-scm.org/wiki/EditingHistory" rel="nofollow noreferrer">https://www.mercurial-scm.org/wiki/EditingHistory</a> there does not appear to be an easily automatable way of doing this. The HistEdit extension does allow doing exactly what I want, but does not seem to be scriptable. My understanding of MQ is that it won't do what I want, since it will never remove the first revision, although it could potentially be used to fold some of the middle revisions.</p> <p><b>Edit</b>: To try and clarify my question a little.</p> <p>Basically, what I want to do is to keep the last 1000 revisions of subversion in my mercurial repository. This is easy to do to start off:</p> <pre><code>hgimportsvn -r$((TRUNKREV-1000)) $TRUNKURL </code></pre> <p>However, after a week my mercurial repository now has 1200 revisions in it, so I want to cut it back to 1000 again, by removing/collapsing the first 200 revisions.</p> <p>Does anyone know how to do this?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload