views:

195

answers:

4

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 geared 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.

+1  A: 

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)

gbjbaanb
You mean just regular file copy into my local mercurial tree? Is there a way to preserve history like the initial import did?
mizipzor
there is no problem adding the .hgignore file to the repo, in fact the book recommends it
jk
+1  A: 

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.

orip
You pretty much nailed it there with what Im aiming for (the edit part). But I still havent figured out if the .svn and .hgsvn folders should be tracked in my copy, you dont happen to know that? Im also waiting for new stuff to show up on the official svn repos to try an update from there.
mizipzor
+1  A: 

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

alexandrul
If the TortoiseHg client would allow me to do both a checkout and then updates from an svn repos while at the same time was able to push to my hg repos it would be awesome. Ill check that out.
mizipzor
+1  A: 

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.

gizmo
At first glance, it seems a bit overkill/complicated. But maybe I underestimate the problem at hand here. I'll look into it, thanks!
mizipzor
If you want, take for reference the workflow descibed here: http://bitbucket.org/segv/hg-website/wiki/Workflows in the section "Dealing with CVS"
gizmo