Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mercurial: Recommended way of sending a whole repository to someone

I have done some programming and I have used Mercurial for source control. I now need to send all of my code to someone else (because they are going to take over).

Since all copies of a mercurial repository is a full and real repository my first thought is to first do a clone of my repository without an update and then zipping and emailing that clone. Is this a good way, or is there a better way?

For example when using the TortoiseHg Repository Explorer I can right-click on a changeset and under Export there are various options that looks like they could be doing something interesting, but I don't quite understand them or know which one to use.

like image 777
Svish Avatar asked Jun 11 '10 21:06

Svish


People also ask

What is a Mercurial repository?

Mercurial is a free, distributed version control system. It's also referred to as a revision control system or Mercurial source control. It is used by software development teams to manage and track changes across projects.

How do I cancel my Mercurial repository?

Jonathan: Removing it is quite proper. We try to keep simple things simple in Mercurial: hg init creates . hg for you, and rm -r . hg will undo that.


2 Answers

What you've suggested will work fine, but you can also use hg bundle to create a changegroup file encapsulating a compressed copy of the entire repository (see hg help bundle for the full details, or this page: http://www.selenic.com/mercurial/hg.1.html#bundle).

On your machine:

hg -R /path/to/repo bundle --all my_repo.hg

Then send my_repo.hg off to the other developer, who can clone directly from that:

hg clone my_repo.hg /path/to/new/clone

(Note: this sort of assumes you're working with linux, but I imagine TortoiseHg supports something similar, since this is a basic feature of Mercurial).

EDIT: Looks like the equivalent using TortoiseHg would be to export a range of changesets as a bundle (see here: http://tortoisehg.bitbucket.io/manual/2.9/patches.html#export-patches). In this case, you want to select the very first changeset all the way up through the tip, and export as a bundle.

like image 76
bjlaub Avatar answered Oct 20 '22 01:10

bjlaub


Every folder is a complete copy of the repository. Simply send the entire folder and they will have everything they need.

Alternatively you can clone a copy of the folder and send them the clone. This would allow them to push changes back to you if needed in the future.

like image 41
Jason Webb Avatar answered Oct 20 '22 01:10

Jason Webb