creating new remote repository for existing project with Mercurial
Asked Answered
M

1

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! )

Myotonia answered 26/7, 2012 at 11:14 Comment(2)
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.Antiquity
I removed your apache tag because we're talking about ssh only -- not apache. That (and hgweb.cgi) are something else.Antiquity
A
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://[email protected]//home/hg/repos/project3  # clone the repo over to the server

Your teammates can then clone down using:

hg clone ssh://[email protected]//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.

Antiquity answered 26/7, 2012 at 12:58 Comment(7)
Thanks for giving your time to help me out with this .I am trying it if I will have any problem I will comment .Myotonia
hg clone . ssh://[email protected]//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 .Myotonia
It Worked! but when I am access dev.myproject.com/private/project3 I am getting error page that is some python code written on it .Myotonia
Welp, put that (well formated) python error page into your qeustiona nd let's figure it out.Antiquity
IDK but I initialized everything and cloned again to new folder and its working fine .Myotonia
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??!Mcnew
@Mcnew Look at foss.heptapod.net (Free and Open Source Software) or about.heptapod.host (Commercial service) also there is a self-hosting option.Cham

© 2022 - 2024 — McMap. All rights reserved.