1

I am (still) trying to completely migrate our company's SVN to HG. For the most part I've succeeded, but we ran across a problem.

Our codebase has over 30 different projects, each one on its folder.

I've been asked multiple times how to commit and then push specific files to our central repository instead of being forced to commit everything everywhere to then push it, it's certainly annoying. Not being able to pull only specific projects is also an nuisance.

Is there any way to handle this like we used to in SVN? Where we could just commit what we wanted and not everything, and update only what was necessary.

Thank you.

SoManyGoblins
  • 5,605
  • 8
  • 45
  • 65
  • If you're using TortoiseHg you can select the files you want to commit. When updating you can click on a previous changeset, right click on a file and choose "Revert to Revision". – Patrick Oct 19 '12 at 12:37
  • You can commit specific files, but on push (to send specific changes to another dev) it warns you have uncommited changes, so it forces you to commit things you do not want to commit. – SoManyGoblins Oct 19 '12 at 13:16
  • 1
    You can use the Shelve function to "put the changes aside", and then push – Patrick Oct 19 '12 at 13:24
  • Not exactly comfortable, looking if there was a more useful solution, but yes. – SoManyGoblins Oct 19 '12 at 13:25
  • What version are you using? Pushing with uncommitted changes doesn't warn about anything, it just syncs existing changesets with a remote repository. – Mark Tolonen Oct 20 '12 at 02:09
  • If other people made changes then you need to pull and merge before pushing. That can't be done with uncommitted changes. – Steve Kaye Oct 21 '12 at 11:46

2 Answers2

6

A major difference between SVN and Mercurial is that you should have one repository per project in Mercurial.

You can change your repository to be multiple repositories using the convert extension.

Steve Kaye
  • 6,262
  • 2
  • 23
  • 27
0

Like Steve Kaye said you should create one repo per project, but as well you may want to create one master repo and include all your projects as subrepos This will allow svn like behavior of getting a copy of everything.

Tom
  • 6,325
  • 4
  • 31
  • 55
  • 1
    But please see [however appealing Mercurial sub-repos may be, do not use them](http://stackoverflow.com/a/11639890/104370) before moving to sub-repositories. – Clare Macrae Oct 20 '12 at 07:51