Lucas
Lucas

Reputation: 89

How to commit to Sourceforge using Mercurial

I have directory named "Proyectos" with Django code inside.

I need to commit the project to Source Forge so my teacher can "download" all the code to his computer.

I think I should use some of these address:

http://phone-apps-djan.hg.sourceforge.net:8000/hgroot/phone-apps-djan/phone-apps-djan (read-only) 
 ssh://[email protected]/hgroot/phone-apps-djan/phone-apps-djan (read/write)

I did this on Kubuntu:

lucas@lucas-Satellite-L305:~/Desarrollo/Python/Django/Proyectos$ hg clone http://phone-apps-djan.hg.sourceforge.net:8000/hgroot/phone-apps-djan/django-mercurial

but only the folder is created.

I'm a novice and didn't find how to do this. I followed some tutorials but I can't understand a lot of concepts.

I would appreciate some assistance with this, please.

Thanks in advance.

Upvotes: 1

Views: 1291

Answers (3)

Lucas
Lucas

Reputation: 89

Many thanks to Rob Sobers and Krtek for their answers. I finally could add all my files to SourceForge. I followed their instructions and everything went fine, although I had some minor complications.

This is the answer to my questions step by step:

Over the folder "Proyectos" I did:

  • hg clone ssh://[email protected]/hgroot/phone-apps-djan/phone-apps-djan and entered the password for my SourceForge account. A folder "phone-apps-djan" was created.

  • hg add after I cd into phone-apps-djan and copied all the files of my project into that folder.

  • hg commit. There was an error at this point: abort: no username supplied (see "hg help config"). So I created a file named .hgrc in my home dir and added these lines:

    [ui]
    username = my username at sourceforce <the mail address I supplied when registering>
    verbose = True
    

Then I re-entered hg commit.

  • hg push. The follow error message was displayed: abort: repository default-push not found!. Then I just re-edited the .hgrc file created on the last step and added:

    [paths]
    default = ssh://[email protected]/hgroot/phone-apps-djan/phone-apps-dja
    

I really don't understand what happened here because the .hg directory in my repo already contains a hgrc file with that path :(. Anyway, I did hg push again.

And that was all.

Upvotes: 2

krtek
krtek

Reputation: 26617

You have two different address to access your Mercurial repository on sourceforge :

  1. http://phone-apps-djan.hg.sourceforge.net:8000/hgroot/phone-apps-djan/phone-apps-djan (read-only), like said after the address, this one is read-only, it is for everyone to clone your project, so they can see the sources and compile / use it. There's no authentication. When you use this address, Mercurial use the HTTP protocol to pull the changes.
  2. ssh://[email protected]/hgroot/phone-apps-djan/phone-apps-djan (read/write), you can write to your repository through this address, but you have to authenticate yourself (you'll have to enter your password) and Mercurial use the SSH protocol to do that. You can also see your sourceforge username in the address.

First of all, you must do another clone of your project with the second address, otherwise you won't be able to commit. Just cd in a new directory and do :

hg clone ssh://[email protected]/hgroot/phone-apps-djan/phone-apps-djan

You should be prompted for your sourceforge account password.

Then, you can cd in the newly created directory, do all your changes, add files, etc. When you're done, you can do a hg commitand then a hg push to publish the modification to your repository. If you add new file to the directory don't forget to do a hg add or hg addremove.

You can find a really good and simple tutorial about mercurial on Hg Init, you should read it and try to understand the workflow before doing anything on sourceforge.

Good luck with your project :)

Upvotes: 2

Rob Sobers
Rob Sobers

Reputation: 21155

Doing hg clone downloaded the repository to your computer. Now, to update your working directory (so you can work with the files), type hg update.

When you're done making changes, type hg commit to record them. When you're ready upload your changes to SourceForge, type hg push http://path/to/repo. Make sure you push up to the correct repository!

Upvotes: 1

Related Questions