首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在git工程中插入hg工程?

如何在git工程中插入hg工程?
EN

Stack Overflow用户
提问于 2016-05-02 20:37:30
回答 1查看 164关注 0票数 0

我知道this post。我尝试通过这种方式将mercurial项目(即eigen project)插入到给定的git项目中。

当我尝试克隆它时,我得到的结果如下所示

代码语言:javascript
复制
Initialized empty Git repository in /tmp/.../.git/
Fordere alle ?nderungen an
F?ge ?nderungss?tze hinzu
F?ge Manifeste hinzu
F?ge Datei?nderungen hinzu
F?gte 8820 ?nderungss?tze mit 28623 ?nderungen an 2757 Dateien hinzu (+4 K?pfe)
Initialized empty Git repository in /tmp/multikopter/foo/.git/hgremote/
Error: repository has at least one unnamed head: hg r8485
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            0 (         0 duplicates                  )
  blobs  :            0 (         0 duplicates          0 deltas of          0 attempts)
  trees  :            0 (         0 duplicates          0 deltas of          0 attempts)
  commits:            0 (         0 duplicates          0 deltas of          0 attempts)
  tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           0 (         0 loads     )
  marks:           1024 (         0 unique    )
  atoms:              0
Memory total:          2282 KiB
   pools:          2048 KiB
 objects:           234 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit      = 8589934592
pack_report: pack_used_ctr            =          0
pack_report: pack_mmap_calls          =          0
pack_report: pack_open_windows        =          0 /          0
pack_report: pack_mapped              =          0 /          0
---------------------------------------------------------------------

fatal: Couldn't find remote ref HEAD
fatal: The remote end hung up unexpectedly

当使用标志--force时,这会导致巨大的输出,并且至少会根据需要在git中创建一些提交。但是,该进程将以输出终止

代码语言:javascript
复制
Traceback (most recent call last):
  File "/usr/share/hg-fast-export/hg-fast-export.py", line 387, in <module>
    options.statusfile,authors=a,sob=options.sob,force=options.force))
  File "/usr/share/hg-fast-export/hg-fast-export.py", line 298, in hg2git
    ui,repo=setup_repo(repourl)
  File "/usr/share/hg-fast-export/hg2git.py", line 34, in setup_repo
return myui,hg.repository(myui,url)
  File "/usr/lib/python2.7/dist-packages/mercurial/hg.py", line 112, in repository
    peer = _peerorrepo(ui, path, create)
  File "/usr/lib/python2.7/dist-packages/mercurial/hg.py", line 102, in _peerorrepo
    obj = _peerlookup(path).instance(ui, path, create)
  File "/usr/lib/python2.7/dist-packages/mercurial/localrepo.py", line 2478, in instance
    return localrepository(ui, util.urllocalpath(path), create)
  File "/usr/lib/python2.7/dist-packages/mercurial/localrepo.py", line 217, in __init__
    raise error.RepoError(_("repository %s not found") % path)
mercurial.error.RepoError: Projektarchiv  nicht gefunden

最后一个文本在德语中的意思是repository not found

如果我尝试git hg fetchgit hg pull,我会得到完全相同的回溯。此外,似乎并不是所有来自eigen library的提交都是刚刚创建的git存储库的一部分。当比较git中master的最新提交数与mercurial中的最新提交数时,会发现有一年多的差异(至少对我来说是这样)。

有人能证实这一点吗?

我怎样才能克服这个问题?(设置了主项目的GIT。问题是如何将库集成到匹配的版本中。)

有没有人能告诉我一个可以替代git-hg的好方法?

EN

回答 1

Stack Overflow用户

发布于 2016-05-03 16:36:13

主要问题(目前)

错误:存储库至少有一个未命名的头: hg r8485

Mercurial在命名分支中可以有多个头部,Git-branching很难看,也很弱,Git无法处理这种情况。也就是说,r8485是default分支的封闭头(但关闭只在某些区域有意义,并且只对Mercurial有意义)

代码语言:javascript
复制
>hg log -r "heads(branch(default))"
changeset:   8485:59a7e404a93c
parent:      8483:df620f192518
user:        Christoph Hertzberg <chtz@informatik.uni-bremen.de>
date:        Thu Mar 17 19:38:45 2016 +0100
summary:     closing wrong default

changeset:   8820:1249b66e1544
tag:         tip
user:        Benoit Steiner <benoit.steiner.goog@gmail.com>
date:        Mon May 02 19:50:22 2016 -0700
summary:     Made a cast explicit

可能的解决方案(需要使用Mercurial)

  • 虚拟-将8485合并到当前的tip
  • 原始存储库的部分克隆,其中排除(所有)叶节点
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/36982649

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档