使用 hggit 克隆 github 存储库 - 中止:未找到存储库

发布于 2024-11-16 16:10:34 字数 8721 浏览 4 评论 0原文

我正在尝试使用 hggit 在本地克隆一些 github 存储库。我按照 tutorial 说明进行操作,

$ hg clone git://github.com/schacon/hg-git.git
abort: repository git://github.com/schacon/hg-git.git not found!

$ hg clone git+ssh://[email protected]/schacon/hg-git.git
abort: repository git+ssh://[email protected]/schacon/hg-git.git not found!

我知道我有 hggit,因为以下内容

$ python -c "import hggit"
$ head -n1 `which hg`
#!/opt/local/Library/Frameworks/Python.framework/Versions/2.6/Resources/Python.app/Contents/MacOS/Python
$ /opt/local/Library/Frameworks/Python.framework/Versions/2.6/Resources/Python.app/Contents/MacOS/Python -c "import hggit"

也有效,我有另一个 github 存储库,我经常与 hg 一起使用。我忘记了最初是如何让它工作的,但我认为这是我推入 github 的一个新的仓库。在我确实有一个工作存储库的文件夹中,我的 .hg/hgrc 中有以下内容(为了隐私而解释):

github = git+ssh://[email protected]:myname/repo.git

[ui]
username = Fname Lname <[email protected]>

[extensions]
hgext.bookmarks =
hggit =

但是当然,我只是想克隆的存储库没有 hgrc。

更新

$ hg help 给出类似

Mercurial Distributed SCM

list of commands:

 add          add the specified files on the next commit
 addremove    add all new files, delete all missing files
 annotate     show changeset information by line for each file
 archive      create an unversioned archive of a repository revision
 backout      reverse effect of earlier changeset
 bisect       subdivision search of changesets
 branch       set or show the current branch name
 branches     list repository named branches
 bundle       create a changegroup file
 cat          output the current or given revision of files
 clone        make a copy of an existing repository
 commit       commit the specified files or all outstanding changes
 copy         mark files as copied for the next commit
 diff         diff repository (or selected files)
 export       dump the header and diffs for one or more changesets
 forget       forget the specified files on the next commit
 grep         search for a pattern in specified files and revisions
 heads        show current repository heads or show branch heads
 help         show help for a given topic or a help overview
 identify     identify the working copy or specified revision
 import       import an ordered set of patches
 incoming     show new changesets found in source
 init         create a new repository in the given directory
 locate       locate files matching specific patterns
 log          show revision history of entire repository or files
 manifest     output the current or given revision of the project manifest
 merge        merge working directory with another revision
 outgoing     show changesets not found in the destination
 parents      show the parents of the working directory or revision
 paths        show aliases for remote repositories
 pull         pull changes from the specified source
 push         push changes to the specified destination
 recover      roll back an interrupted transaction
 remove       remove the specified files on the next commit
 rename       rename files; equivalent of copy + remove
 resolve      redo merges or set/view the merge status of files
 revert       restore individual files or directories to an earlier state
 rollback     roll back the last transaction (dangerous)
 root         print the root (top) of the current working directory
 serve        start stand-alone webserver
 showconfig   show combined config settings from all hgrc files
 status       show changed files in the working directory
 summary      summarize working directory state
 tag          add one or more tags for the current or given revision
 tags         list repository tags
 tip          show the tip revision

 unbundle     apply one or more changegroup files
 update       update working directory (or switch revisions)
 verify       verify the integrity of the repository
 version      output version and copyright information

additional help topics:

 config       Configuration Files
 dates        Date Formats
 patterns     File Name Patterns
 environment  Environment Variables
 revisions    Specifying Single Revisions
 multirevs    Specifying Multiple Revisions
 revsets      Specifying Revision Sets
 diffs        Diff Formats
 merge-tools  Merge Tools
 templating   Template Usage
 urls         URL Paths
 extensions   Using additional features
 subrepos     Subrepositories
 hgweb        Configuring hgweb
 glossary     Glossary

use "hg -v help" to show aliases and global options

$ hg help extensions 给出类似

Using additional features

    Mercurial has the ability to add new features through the use of extensions. Extensions may add new commands, add options to existing commands, change the default
    behavior of commands, or implement hooks.

    Extensions are not loaded by default for a variety of reasons: they can increase startup overhead; they may be meant for advanced usage only; they may provide
    potentially dangerous abilities (such as letting you destroy or modify history); they might not be ready for prime time; or they may alter some usual behaviors of
    stock Mercurial. It is thus up to the user to activate extensions as needed.

    To enable the "foo" extension, either shipped with Mercurial or in the Python search path, create an entry for it in your configuration file, like this:

      [extensions]
      foo =

    You may also specify the full path to an extension:

      [extensions]
      myfeature = ~/.hgext/myfeature.py

    To explicitly disable an extension enabled in a configuration file of broader scope, prepend its path with !:

      [extensions]
      # disabling extension bar residing in /path/to/extension/bar.py
      bar = !/path/to/extension/bar.py
      # ditto, but no path was supplied for extension baz
      baz = !

    disabled extensions:

     acl         hooks for controlling repository access
     bookmarks   track a line of development with movable markers
     bugzilla    hooks for integrating with the Bugzilla bug tracker
     children    command to display child changesets
     churn       command to display statistics about repository history
     color       colorize output from some commands
     convert     import revisions from foreign VCS repositories into Mercurial
     eol         automatically manage newlines in repository files
     extdiff     command to allow external programs to compare revisions
     fetch       pull, update and merge in one command
     gpg         commands to sign and verify changesets
     graphlog    command to view revision graphs from a shell
     hgcia       hooks for integrating with the CIA.vc notification service
     hgk         browse the repository in a graphical way
     highlight   syntax highlighting for hgweb (requires Pygments)
     interhg     expand expressions into changelog and summaries
     keyword     expand keywords in tracked files
     mq          manage a stack of patches
     notify      hooks for sending email notifications at commit/push time
     pager       browse command output with an external pager
     parentrevspec
                 interpret suffixes to refer to ancestor revisions
     patchbomb   command to send changesets as (a series of) patch emails
     progress    show progress bars for some actions
     purge       command to delete untracked files from the working directory
     rebase      command to move sets of revisions to a different ancestor
     record      commands to interactively select changes for commit/qrefresh
     relink      recreates hardlinks between repository clones
     schemes     extend schemes with shortcuts to repository swarms
     share       share a common history between several working directories
     transplant  command to transplant changesets from another branch
     win32mbcs   allow the use of MBCS paths with problematic encodings
     win32text   perform automatic newline conversion
     zeroconf    discover and advertise repositories on the local network

更新:修复 所以问题是我没有“$HOME/.hgrc”文件来使用扩展名。添加此文件和扩展信息后,一切正常!

I am trying to clone some github repos locally with hggit. I am following tutorial instructions to do

$ hg clone git://github.com/schacon/hg-git.git
abort: repository git://github.com/schacon/hg-git.git not found!

$ hg clone git+ssh://[email protected]/schacon/hg-git.git
abort: repository git+ssh://[email protected]/schacon/hg-git.git not found!

I know I have hggit because the following works

$ python -c "import hggit"
$ head -n1 `which hg`
#!/opt/local/Library/Frameworks/Python.framework/Versions/2.6/Resources/Python.app/Contents/MacOS/Python
$ /opt/local/Library/Frameworks/Python.framework/Versions/2.6/Resources/Python.app/Contents/MacOS/Python -c "import hggit"

Also, I have another github repo that I regularly use with hg. I forgot how I initially got it to work, but I think it was a fresh repo that I pushed into github. In the folder where I do have a working repo, I have the following (paraphrased for privacy) in my .hg/hgrc:

github = git+ssh://[email protected]:myname/repo.git

[ui]
username = Fname Lname <[email protected]>

[extensions]
hgext.bookmarks =
hggit =

but of course there is no hgrc for the repo that I am just trying to clone.

Update

$ hg help gives something like

Mercurial Distributed SCM

list of commands:

 add          add the specified files on the next commit
 addremove    add all new files, delete all missing files
 annotate     show changeset information by line for each file
 archive      create an unversioned archive of a repository revision
 backout      reverse effect of earlier changeset
 bisect       subdivision search of changesets
 branch       set or show the current branch name
 branches     list repository named branches
 bundle       create a changegroup file
 cat          output the current or given revision of files
 clone        make a copy of an existing repository
 commit       commit the specified files or all outstanding changes
 copy         mark files as copied for the next commit
 diff         diff repository (or selected files)
 export       dump the header and diffs for one or more changesets
 forget       forget the specified files on the next commit
 grep         search for a pattern in specified files and revisions
 heads        show current repository heads or show branch heads
 help         show help for a given topic or a help overview
 identify     identify the working copy or specified revision
 import       import an ordered set of patches
 incoming     show new changesets found in source
 init         create a new repository in the given directory
 locate       locate files matching specific patterns
 log          show revision history of entire repository or files
 manifest     output the current or given revision of the project manifest
 merge        merge working directory with another revision
 outgoing     show changesets not found in the destination
 parents      show the parents of the working directory or revision
 paths        show aliases for remote repositories
 pull         pull changes from the specified source
 push         push changes to the specified destination
 recover      roll back an interrupted transaction
 remove       remove the specified files on the next commit
 rename       rename files; equivalent of copy + remove
 resolve      redo merges or set/view the merge status of files
 revert       restore individual files or directories to an earlier state
 rollback     roll back the last transaction (dangerous)
 root         print the root (top) of the current working directory
 serve        start stand-alone webserver
 showconfig   show combined config settings from all hgrc files
 status       show changed files in the working directory
 summary      summarize working directory state
 tag          add one or more tags for the current or given revision
 tags         list repository tags
 tip          show the tip revision

 unbundle     apply one or more changegroup files
 update       update working directory (or switch revisions)
 verify       verify the integrity of the repository
 version      output version and copyright information

additional help topics:

 config       Configuration Files
 dates        Date Formats
 patterns     File Name Patterns
 environment  Environment Variables
 revisions    Specifying Single Revisions
 multirevs    Specifying Multiple Revisions
 revsets      Specifying Revision Sets
 diffs        Diff Formats
 merge-tools  Merge Tools
 templating   Template Usage
 urls         URL Paths
 extensions   Using additional features
 subrepos     Subrepositories
 hgweb        Configuring hgweb
 glossary     Glossary

use "hg -v help" to show aliases and global options

$ hg help extensions gives something like

Using additional features

    Mercurial has the ability to add new features through the use of extensions. Extensions may add new commands, add options to existing commands, change the default
    behavior of commands, or implement hooks.

    Extensions are not loaded by default for a variety of reasons: they can increase startup overhead; they may be meant for advanced usage only; they may provide
    potentially dangerous abilities (such as letting you destroy or modify history); they might not be ready for prime time; or they may alter some usual behaviors of
    stock Mercurial. It is thus up to the user to activate extensions as needed.

    To enable the "foo" extension, either shipped with Mercurial or in the Python search path, create an entry for it in your configuration file, like this:

      [extensions]
      foo =

    You may also specify the full path to an extension:

      [extensions]
      myfeature = ~/.hgext/myfeature.py

    To explicitly disable an extension enabled in a configuration file of broader scope, prepend its path with !:

      [extensions]
      # disabling extension bar residing in /path/to/extension/bar.py
      bar = !/path/to/extension/bar.py
      # ditto, but no path was supplied for extension baz
      baz = !

    disabled extensions:

     acl         hooks for controlling repository access
     bookmarks   track a line of development with movable markers
     bugzilla    hooks for integrating with the Bugzilla bug tracker
     children    command to display child changesets
     churn       command to display statistics about repository history
     color       colorize output from some commands
     convert     import revisions from foreign VCS repositories into Mercurial
     eol         automatically manage newlines in repository files
     extdiff     command to allow external programs to compare revisions
     fetch       pull, update and merge in one command
     gpg         commands to sign and verify changesets
     graphlog    command to view revision graphs from a shell
     hgcia       hooks for integrating with the CIA.vc notification service
     hgk         browse the repository in a graphical way
     highlight   syntax highlighting for hgweb (requires Pygments)
     interhg     expand expressions into changelog and summaries
     keyword     expand keywords in tracked files
     mq          manage a stack of patches
     notify      hooks for sending email notifications at commit/push time
     pager       browse command output with an external pager
     parentrevspec
                 interpret suffixes to refer to ancestor revisions
     patchbomb   command to send changesets as (a series of) patch emails
     progress    show progress bars for some actions
     purge       command to delete untracked files from the working directory
     rebase      command to move sets of revisions to a different ancestor
     record      commands to interactively select changes for commit/qrefresh
     relink      recreates hardlinks between repository clones
     schemes     extend schemes with shortcuts to repository swarms
     share       share a common history between several working directories
     transplant  command to transplant changesets from another branch
     win32mbcs   allow the use of MBCS paths with problematic encodings
     win32text   perform automatic newline conversion
     zeroconf    discover and advertise repositories on the local network

Update: Fix
So the problem was that I did not have a '$HOME/.hgrc' file to use the extensions. Once I added this file and the extension information, everything worked fine!

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

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

发布评论

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

评论(4

在风中等你 2024-11-23 16:10:34

在基于 Debian 的 GNU/Linux 发行版上,

$ sudo apt install mercurial-git

我还必须将以下行添加到我的 ~/.hgrc 文件中:

[extensions]
hggit = /usr/share/pyshared/hgext/git

On a Debian-based GNU/Linux distribution, in addition to

$ sudo apt install mercurial-git

I had to add the following lines to my ~/.hgrc file:

[extensions]
hggit = /usr/share/pyshared/hgext/git
音栖息无 2024-11-23 16:10:34

这是一个想法,也许它没有完全安装。我也遇到过类似的问题,并发现手动编译它比使用“easy_install”效果更好。我遇到了“dulwhich”版本安装不正确的问题,所以事情被破坏了(可能与你的类似)。

我在我的博客上概述了安装过程 -> http://andypeters.org/post/5607486048/hg -git-installation-woes-on-a-mac

这是安装的快速摘要。

  1. 下载。我一直用0.7。
  2. 安装德威。请注意 --pure 的使用。我不是 100% 确定这意味着什么,但我的理解是,对其进行不同/干净的安装是 python 的事情。

    <前><代码>> sudo python setup.py --pure install

  3. 下载 hg-git。我已经链接到 bitbucket,因为我假设你有 Mercurial 工作。

  4. 安装hg-git

    <前><代码>> sudo python setup.py 安装

希望有帮助。

Here is a thought, maybe its not fully installed. I have had similar problems and found compiling it manually instead of using 'easy_install' to work better. I had problems where the version of 'dulwhich' wasn't installed properly, so things were broken (probably similarly to yours).

I outlined the installation process here on my blog -> http://andypeters.org/post/5607486048/hg-git-installation-woes-on-a-mac

Here is a quick summary for installation.

  1. Download. I have been using 0.7.
  2. Install dulwich. Notice the use of --pure. I'm not 100% sure what that means, but my understanding is that it is a python thing to make a different/clean install of it.

    > sudo python setup.py --pure install
    
  3. Download hg-git. I have linked to bitbucket because i assume you have mercurial working.

  4. Install hg-git

    > sudo python setup.py install
    

Hope that helps.

孤星 2024-11-23 16:10:34

我在 ubuntu 14.04 上的配置(参见 Mercurial-git 包中的 /usr/share/doc/mercurial-git/README.Debian):

[extensions]
hgext.bookmarks =
hgext.git = 

要添加此内容的文件是:~/.hgrc

my config on ubuntu 14.04 (cf /usr/share/doc/mercurial-git/README.Debian from package mercurial-git):

[extensions]
hgext.bookmarks =
hgext.git = 

The file to add this is : ~/.hgrc

太阳公公是暖光 2024-11-23 16:10:34

要在 Mercurial 中启用 hg-git (注意“-”),您需要类似以下内容:

[extensions]
hg-git=e:\hg-extensions\hg-git\hggit

To enable hg-git (note the '-') in mercurial, you need something like:

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