Ada*_*deg 13 git mercurial hg-git
我正在尝试使用hg pushgit存储库,但它默默地失败了.我在邮件列表上发现了一个帖子和一个注册的hg-git问题,但两者都是大约半年没有太多活动.所以我开始认为我误解/错误配置了一些东西.我的~/.hgrc包含
[extensions]
hgext.bookmarks =
hgext.git =
#hggit = /path/to/hg-git-0.3.1/hggit
[bookmarks]
track.current = True
Run Code Online (Sandbox Code Playgroud)
此代码段重现了此问题:
mkdir /tmp/Git
cd /tmp/Git
git init
echo 'something' > myfile
git add .
git commit -m 'Started'
cd ..
hg clone /tmp/Git /tmp/Hg
cd /tmp/Hg
echo 'another thing' >> myfile
hg ci -m 'Working'
hg log
# Two items listed
hg push
cd ../Git
git log
# Only one item listed, but two expected
Run Code Online (Sandbox Code Playgroud)
我尝试了hg-git 0.2.6-2Ubuntu 11.10和最新的标记版本0.3.1.我的好消息是版本1.9.1
hg update master在提交之前和hg bookmark -f master提交之后,我甚至尝试了两种提议的解决方法,但两者都给出了错误.
更新:
Ada*_*deg 19
这里有两个问题:push应该明确失败,而hg-git应该报告它(但它没有).
推送应该失败,"abort: git remote error: refs/heads/master failed to update" when pushing to local clone因为它是对非裸存储库的推动(从多变的用户的角度来看更多内容).上面代码片段的工作版本是这样的(注意使用Bare存储库).
mkdir /tmp/Git
cd /tmp/Git
git init
echo 'something' > myfile
git add .
git commit -m 'Started'
cd ..
git clone --bare -l /tmp/Git /tmp/Bare
hg clone /tmp/Bare/ /tmp/Hg
cd /tmp/Hg
echo 'another thing' >> myfile
hg ci -m 'Working'
hg log
# Two items listed
hg push
cd ../Bare
git log
# Two items listed
Run Code Online (Sandbox Code Playgroud)
关于,为什么要hg-git隐藏这个错误,我怀疑这是Ubuntu附带的最新版本的问题.我做的是
apt-get remove mercurial-git python-dulwich
easy_install hg-git
Run Code Online (Sandbox Code Playgroud)
它根据网站删除dulwich 0.7.1并安装了0.8所需的内容hg-git.现在,它对我有用.mercurial版本(1.9.1)似乎工作正常.
| 归档时间: |
|
| 查看次数: |
2691 次 |
| 最近记录: |