开发者

In Mercurial, after "hg init" to create a project and pushing onto server, how to make local directory to have "hg path" of the server?

When a project is started with

开发者_高级运维
mkdir proj
cd proj
hg init
[create some files]
hg add file.txt
hg commit
hg push ssh://me@somewhere.somehost.com/proj

now when hg path is issued, nothing will show. How do we actually change the repository so that it is as if it is cloned from me@somewhere.somehost.com/proj ? Is it just by editing .hg/hgrc and adding

[paths]
default = ssh://me@somewhere.somehost.com/proj

because that feels like too low level an operation to do (by editing a text file)


It's the only way to do it in this situation. There are plenty of other cases where you have to edit the hgrc by hand, like setting up hooks or enabling extensions, so it's not as if it's unusual.

(As you probably already know, hg clone will set the path entry in the clone to point back to the original.)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜