用gggit克隆github回购 [英] Cloning github repo with hggit

查看:150
本文介绍了用gggit克隆github回购的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图用hggit在本地克隆一些github回购站。我遵循教程的说明操作

  $ hg clone git://github.com/schacon/hg-git.git 
abort:repository git://github.com/schacon/hg-没有找到git.git!

$ hg clone git + ssh://git@github.com/schacon/hg-git.git
abort:repository git + ssh://git@github.com/schacon /hg-git.git找不到!

我知道我有hggit,因为以下作品

  $ python -cimport 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 - cimport hggit

另外,我有另一个github仓库,我经常使用hg。我忘了我最初是如何工作的,但我认为这是一个新的回购,我推入github。在我有一个工作回购的文件夹中,我在.hg / hgrc中有以下内容(解释为隐私):

  github = git + ssh://git@github.com:myname / repo.git 

[ui]
username = Fname Lname< email@gmail.com>

[扩展]
hgext.bookmarks =
hggit =

但当然没有用于回购的hgrc,我只是想克隆。



更新



$ hg help 给出类似于

  Mercurial Distributed SCM 

命令列表:

在下一次提交时添加指定的文件
addremove添加所有新文件,删除所有丢失的文件
注释为每个文件逐行显示变更集信息
归档创建版本库修订版的未版本化归档
退出先前变更集的反转效果
变更集的二分细分搜索
分支集或显示当前分支名称
分支列表存储库命名分支
bundle创建changegroup文件
cat输出文件的当前或给定修订
克隆制作现有代表的副本ository
commit提交指定的文件或所有未完成的更改
复制标记文件作为下一次提交复制
diff diff存储库(或选定文件)
导出转储标题和差异一个或多个变更集
忘记忘记下一次提交的指定文件
grep搜索指定文件和修订版中的模式
头显示当前存储库头或显示分支头
帮助显示对特定主题或帮助概述的帮助
标识标识工作副本或指定修订
导入导入一组已定购的修补程序
在源中显示新变更集
init创建一个给定目录中的新存储库
定位匹配特定模式的文件
log显示整个存储库或文件的修订历史
清单输出项目清单的当前或给定修订
me rge将工作目录与另一个版本合并
在目标中找不到发送的显示更改集
父母显示工作目录或修订版的父母
路径显示远程存储库的别名
拉出拉动更改从指定源
将推送更改推送到指定目标
恢复回滚中断事务
删除删除下一次提交的指定文件
重命名重命名文件;等价于复制+删除
解析重做合并或设置/查看文件的合并状态
恢复将单个文件或目录恢复到以前的状态
回滚回滚最后一个事务(危险)
root打印当前工作目录的根(顶部)
服务启动独立webserver
showconfig显示所有hgrc文件的组合配置
状态显示工作目录中已更改的文件
摘要汇总工作目录状态
标记为当前或给定的修订添加一个或多个标记
标记列表资料库标记
提示显示提示修订

unbundle应用一个或多个更改组文件
更新工作目录(或切换版本)
验证存储库的完整性
版本输出版本和版权信息

附加帮助主题:

配置配置文件
日期日期格式
模式文件名模式
环境变量
指定单个修订
multirevs指定多个修订
修订集指定修订集
diffs Diff格式
merge-tools合并工具
模板模板使用
URL URL路径
扩展使用附加功能
subrepos子存储
hgweb配置hgweb
词汇表术语表

使用hg -v help显示别名和全局选项

$ hg help extensions 给出类似于

 使用附加功能

Mercurial能够通过使用扩展来添加新功能。扩展可能会添加新命令,向现有命令添加选项,更改命令的默认
行为或实现挂钩。

由于各种原因,扩展未默认加载:它们会增加启动开销;它们可能仅用于高级用途;他们可能会提供
潜在的危险能力(例如让你销毁或修改历史记录);他们可能没有准备好黄金时段;或者他们可能会改变一些通常的行为
股票Mercurial。因此,用户根据需要激活扩展。

为了启用随附于Mercurial或Python搜索路径的foo扩展,请在配置文件中为其创建一个条目,如下所示:

[extensions ]
foo =

您也可以指定扩展名的完整路径:

[extensions]
myfeature =〜/ .hgext / myfeature。 py

要显式禁用在更广泛范围的配置文件中启用的扩展,请在其前面添加!:
$ b $ [扩展]
#禁用扩展栏/path/to/extension/bar.py
bar =!/path/to/extension/bar.py
#同上,但没有路径提供给扩展baz
baz =!

禁用的扩展:

acl钩子用于控制存储库访问
书签跟踪带有可移动标记的开发线
bugzilla挂钩用于集成Bugzilla错误跟踪器
children显示子变更集的命令
churn命令显示关于存储库历史记录的统计信息
颜色着色从某些命令输出
将外部VCS存储库的输入修订版转换为Mercurial
eol自动管理存储库文件中的新行
extdiff命令允许外部程序比较修订
在一个命令中读取,更新和合并
gpg命令签署和验证变更集
graphlog命令从shell中查看修订图
hgcia钩子用于与CIA.vc通知服务集成
hgk在图形中浏览存储库al way
突出显示hgweb的语法高亮(需要Pygments)
interhg将表达式扩展为changelog和摘要
关键字在跟踪文件中展开关键字
mq管理一叠补丁
通知挂钩在提交/推送时发送电子邮件通知
带外部寻呼机的寻呼机浏览命令输出
parentrevspec
引用祖先修订版本的后缀$ b $ patchbomb命令将变更集发送为一系列)修补程序电子邮件
进度显示某些操作的进度栏
purge命令从工作目录中删除未跟踪的文件
rebase命令将修订集移动到不同的祖先
记录命令以交互方式选择commit / qrefresh的更改
relink重新创建存储库克隆之间的硬链接
方案使用快捷方式扩展方案库群
份额的份额数工作目录
移植命令之间移植的变更从另一个分支
win32mbcs共同的历史允许使用的有问题的编码
win32text执行自动换行转换MBCS路径
zeroconf在本地网络上发现和广告存储库

更新:修复 strong>
所以问题在于我没有'$ HOME / .hgrc'文件来使用扩展。一旦我添加了这个文件和扩展信息,一切工作正常!

解决方案

这是一个想法,也许它没有完全安装。我有类似的问题,并发现手动编译而不是使用'easy_install'来更好地工作。我有问题,'dulwhich'的版本安装不正确,所以事情被打破了(可能与你的相似)。



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



以下是安装的简要摘要。


  1. 下载。我一直在使用0.7。

  2. 安装德威。注意 - 使用 - 纯。我不是100%确定这意味着什么,但我的理解是,对其进行不同的/干净的安装是一件蟒蛇事情。

     > sudo python setup.py --pure install 


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


  4. 安装hg-git

     > sudo python setup.py install 



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://git@github.com/schacon/hg-git.git
abort: repository git+ssh://git@github.com/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://git@github.com:myname/repo.git

[ui]
username = Fname Lname <email@gmail.com>

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

解决方案

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.

这篇关于用gggit克隆github回购的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆