如何使用 Mercurial 提交 Sourceforge

发布于 2024-11-10 13:13:43 字数 809 浏览 5 评论 0 原文

我有一个名为“Proyectos”的目录,里面有 Django 代码。

我需要将项目提交给 Source Forge,以便我的老师可以将所有代码“下载”到他的计算机上。

我想我应该使用其中一些地址:

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)

我在 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

但只创建了文件夹。

我是新手,没有找到如何做到这一点。我遵循了一些教程,但我无法理解很多概念。

请提供一些帮助,我将不胜感激。

提前致谢。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

往昔成烟 2024-11-17 13:13:43

您有两个不同的地址来访问 sourceforge 上的 Mercurial 存储库:

  1. http://phone-apps-djan.hg.sourceforge.net:8000/hgroot/phone-apps-djan/phone-apps-djan(读- only),就像地址后面所说的,这个是只读的,它是供每个人克隆你的项目的,这样他们就可以看到源代码并编译/使用它。没有认证啊当您使用此地址时,Mercurial 使用 HTTP 协议来提取更改。
  2. ssh://[电子邮件受保护]/h格鲁特/电话- apps-djan/phone-apps-djan(读/写),您可以通过此地址写入您的存储库,但您必须验证自己的身份(您必须输入密码)并且 Mercurial 使用 SSH协议来做到这一点。您还可以在地址中看到您的 sourceforge 用户名。

首先,您必须使用第二个地址再次克隆您的项目,否则您将无法提交。只需在新目录中 cd 并执行以下操作:

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

系统会提示您输入 sourceforge 帐户密码。

然后,您可以在新创建的目录中 cd 进行所有更改、添加文件等。完成后,您可以执行 hg commit,然后执行 hg Push 将修改发布到您的存储库。如果您向目录添加新文件,请不要忘记执行 hg addhg addremove

你可以在 Hg Init 上找到一个关于 Mercurial 的非常好的和简单的教程,你应该先阅读它并尝试理解工作流程在 Sourceforge 上做任何事情。

祝你的项目好运:)

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

哑剧 2024-11-17 13:13:43

非常感谢 Rob Sobers 和 Krtek 的回答。我终于可以将所有文件添加到 SourceForge 中。我按照他们的指示进行,一切都很顺利,尽管我遇到了一些小并发症。

这是我的问题的逐步答案:

在文件夹“Proyectos”上,我做了:

  • hg clone ssh://[电子邮件受保护]/hgroot/phone-apps-djan/phone-apps-djan并输入我的 SourceForge 帐户的密码。创建了文件夹“phone-apps-djan”。

  • hg add 在我 cd 进入 phone-apps-djan 并将项目的所有文件复制到该文件夹​​中之后。

  • hg 提交。此时出现错误:中止:未提供用户名(请参阅“hg help config”)。因此,我在我的主目录中创建了一个名为 .hgrc 的文件,并添加了以下几行:

    <前><代码>[ui]
    username = 我在 sourceforce 的用户名 <我注册时提供的邮件地址>;
    详细 = 真

然后我重新输入 hg commit

  • hg 推送。显示以下错误消息:abort:未找到存储库默认推送!。然后我重新编辑了上一步创建的 .hgrc 文件并添加:

    <前><代码>[路径]
    默认 = ssh://[电子邮件受保护]/hgroot/phone-apps-djan/phone-apps-dja

我真的不明白这里发生了什么,因为我的存储库中的 .hg 目录已经包含 hgrc< /code> 具有该路径的文件:(。无论如何,我再次执行了 hg push

仅此而已。

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.

傲娇萝莉攻 2024-11-17 13:13:43

执行hg clone将存储库下载到您的计算机上。现在,要更新您的工作目录(以便您可以使用文件),请输入 hg update

完成更改后,输入 hg commit 进行记录。当您准备好将更改上传到 SourceForge 时,请输入 hg push http://path/to/repo。确保您推送到正确的存储库!

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!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文