0

I hope this is OK to ask here instead of superuser since I get very little response there to very specific questions like this.

I have a project that's under mercurial revision control and I'd like to move where it is located on my computer (from ~/workspace to ~/Dropbox/Projects). But if I move the project and then re-import it, it loses the mercurial connection.

I can just commit, push, delete my project, and re-import from hg in the new directory. But there has to be an easier way, no?

Falmarri
  • 47,727
  • 41
  • 151
  • 191
  • I have to say there's something very slightly perverse about putting your Mercurial repo in Dropbox. :) – Cowan Sep 30 '10 at 20:37
  • Lol I agree. I had it in drobox before, decided I should probably not do that. But the mercurial repository is only accessible through the intranet, and the mercurial server doesn't have a route to the vpn. So I said screw it I'm moving it back, lol – Falmarri Sep 30 '10 at 20:42

2 Answers2

0

I don't know specifically about Mercurial, but with some version control systems, moving a checked out copy of the code is very hard (some VCS keep metadata with absolute paths, etc.). So I would commit and re-fetch, personally.

Also, consider the possibility of losing that uncommitted work during the move...

dty
  • 18,795
  • 6
  • 56
  • 82
  • Well I'd commit before I moved it just to be sure. This is mostly just for the sake of knowing whether there is a supported way of doing this, since going through re-checkout seems unnecessary. – Falmarri Sep 30 '10 at 17:56
  • Mercurial (and other DVCS like git) don't have the TFS Workspace Problem. Instead, each .hg folder is a full repository for its parent folder, and commits are shared with other repositories (often including a central one, perhaps at [github](https://github.com/) or [bitbucket](https://bitbucket.org/)) with commands like push/pull/clone. See [Joel's hginit.com](http://www.hginit.com) for more info. – Ed Brannin Feb 08 '11 at 20:08
0

When you move the project, can you confirm if the .hg subfolder (which holds the repository data) moved as well?

Is the moved repository accessible using a command-line or a different mercurial (say TortoiseHg) client?

In Eclipse, what happens when you do "Team -> Share Project..." again?

Raghuram
  • 51,854
  • 11
  • 110
  • 122
  • I moved it with mv -r project /path/to/new/project. And I guess what's happening is hgeclipse (mercurial client) no longer sees it as a mercurial project – Falmarri Sep 30 '10 at 20:43