8

I have a project with version.2 and i have to start working on it to develop a new version.3 . I want to create a new repo on a remote server (i.e. a mercurial-server) so that my team member could access that repo .I have my project file on my local machine .

I have two concerned questions :

  1. How can I create it in /home/hg/repositories/private/project3 (Lets say new repo name would be project3) of remote mercurial-server with my project files. What steps should I follow to do this.

  2. How can I create a access permission (usrname/pword) so that my team will access this repo on http://dev.myproject.com/private/project3 .

Note: /home/hg/repositories/ is default for http://dev.myproject.com/ and I have no repo of version 2 (clone is not possible I guess! )

Ry4an Brase
  • 78,112
  • 7
  • 148
  • 169
Subhransu Mishra
  • 3,035
  • 11
  • 40
  • 47
  • mercurial-server is not the Mercurial server. It's not really even a Mercurial server. It's a third party application that adds some user management stuff to the ssh layer that is one of the transport mechanisms Mercurial supports natively. It almost always causes more confusion than assistance. – Ry4an Brase Jul 26 '12 at 12:59
  • I removed your apache tag because we're talking about ssh only -- not apache. That (and hgweb.cgi) are something else. – Ry4an Brase Jul 26 '12 at 18:45

1 Answers1

16

Without installing additional server side software your team will need ssh accounts on that box. I'm assuming you have one and that you can create them for your friends. If you don't have that setup you're better off just using bitbucket, which is free and provides both ssh and ftp access.

Also, you don't say if you project2 is already under Mercurial control, so I'm assuming it's not.

To create the remote repo you'd do something like this on your local machine:

hg init project3   # <-- creates a new empty respository
cp ALL_THE_PROJECT3_FILES_YOU_WANT project3  # <--- put the files you want into project3
cd project3   # <-- go into your local project3 repository
hg addremove   # <-- LOCALLY add the files you copied in
hg commit -m "initial commit copied in project2"  # <-- LOCALLY commit the files
cd ..   # <---- go up a directory
hg clone project3 ssh://yourusername@dev.myproject.com//home/hg/repos/project3  # clone the repo over to the server

Your teammates can then clone down using:

hg clone ssh://theirusername@dev.myproject.com//home/hg/repos/project3

Here are some things you could accidentally mess up on the way to getting this working:

  • Your friends need ssh accounts
  • your friends accounts need read/write access to /home/hg/repos

Notice that all cloning is happening over ssh. Setting up HTTP is harder and probably not something you need to do.

Seriously, just use bitbucket.

Ry4an Brase
  • 78,112
  • 7
  • 148
  • 169
  • Thanks for giving your time to help me out with this .I am trying it if I will have any problem I will comment . – Subhransu Mishra Jul 26 '12 at 13:17
  • 1
    hg clone . ssh://yourusername@dev.myproject.com//home/hg/repos/project3 will clone remote repo to local not the reverse . I want the reverse . I have created repo on local with my files , now i want to clone it to remote server . – Subhransu Mishra Jul 26 '12 at 14:12
  • It Worked! but when I am access http://dev.myproject.com/private/project3 I am getting error page that is some python code written on it . – Subhransu Mishra Jul 26 '12 at 17:09
  • Welp, put that (well formated) python error page into your qeustiona nd let's figure it out. – Ry4an Brase Jul 26 '12 at 18:44
  • IDK but I initialized everything and cloned again to new folder and its working fine . – Subhransu Mishra Jul 26 '12 at 18:56
  • Instructions unclear, tried to use bitbucket only to find that they *rudely* discontinued *all* support for Mercurial almost *three* years ago. Seriously, do they *really* think that git LFS is a suitable replacement for the superior binary diff algorithm in Hg??! – Michael May 20 '23 at 23:22