开发者

How to pull changes from svn repos after migration to mercurial

开发者 https://www.devze.com 2022-12-20 11:36 出处:网络
Im working on a patch for an open source project that uses svn. I dont have commit access but I want to version track my own changes. I followed this guide to read and convert the svn repos into a hg

Im working on a patch for an open source project that uses svn. I dont have commit access but I want to version track my own changes. I followed this guide to read and convert the svn repos into a hg one.

I want to be able to pull new changes from the official svn repos into my own local copy, how can that be achieved? After the import, my local folder contained an untracked .hgignore file. Should I add that one to be tracked by mercurial?

I also looked into this tool but it seems more gear开发者_StackOverflow社区ed towards just working locally in mercurial connected to svn repos. I want to put my mercurial repos on bitbucket and for that the former guide seemed to make more sense.

It might be to early to think about but later when my contribution is complete, whats the best way to generate a patch to send upstream? Are there any caveats I should be aware of straight away?

Edit: orip's answer (the edit part of it) sums up pretty much exactly what I want to do: local hg copy which can update from svn but also push to my online bitbucket repos.


Pulling new changes is easy: checkout the svn code, and regularly 'svn update' it, then check those downloaded files into your mercurial repo.

The .hgignore file is there to tell mercurial which file types not to track - ie to ignore. Do not add this to your mercurial repo, chances are it'll just contain the same exclusions as your subversion global-ignores.

Patch generation in SVN is easy, do svn diff > myPatch.diff (after updating the svn repo)


You could consider working with MQ. So, you would have a project managed by two VCS at the same time:

  • SVN: used to stay up-to-date with the main repository
  • HG: where you'll perform addremove commands after each update from SVN and where you'll use MQ to write your patches.

Doing so, it'll aslo be alot easier when the time will be to provide your patch to the main repository.


You could take a look at TortoiseHg wiki on SVN - Using TortoiseHg as a client for a Subversion server section, maybe it will help you make a decision about the tools presented in the Mercurial wiki you linked in your question.

Also, check out the answer given by VonC on this question: Mercurial from Subversion: moves, renames and tags


The guide you used converts svn to hg, but is meant for a one-time conversion, not for continued interoperability.

You want something like hgsubversion.

EDIT: just noticed you linked to it in the question. There shouldn't be a problem keeping a clone of your repository on bitbucket - interact with SVN with hgsubversion locally, and push to bitbucket as you normally would - you have a regular hg repo.

0

精彩评论

暂无评论...
验证码 换一张
取 消