Bazaar (bzr) 预定义位置

发布于 2024-08-15 11:56:00 字数 1158 浏览 1 评论 0原文

Bazaar 有一个 Launchpad 伪协议(lp:),它使用户能够在远程分支中进行操作,而无需编写完整的 Launchpad 位置,我正在寻找一种以如下方式创建自己的伪协议的方法(类似于 GIT):

bzr remote my sftp://[email protected]/home/myuser/myrepo/
bzr push my:mybranch
bzr push my:otherbranch
bzr push my:anotherbranch

...而不是...

bzr push sftp://[email protected]/home/myuser/myrepo/mybranch
bzr push sftp://[email protected]/home/myuser/myrepo/otherbranch
bzr push sftp://[email protected]/home/myuser/myrepo/anotherbranch

...那真是令人痛苦。

我读过有关 bazaar.conf 的内容,但似乎只能为每个分支/存储库设置全局推送位置。我看到的另一种方法是使用别名,但有同样的问题,当需要创建新分支时非常难看。

是否可以在不修改 BZR 代码的情况下做到这一点?这应该是显而易见的...

Bazaar has a Launchpad pseudo-protocol (lp:) that able the user to operate in remote branchs without write full Launchpad location, I'm searching a way to create my own pseudo-protocols in a way like this (similar to GIT):

bzr remote my sftp://[email protected]/home/myuser/myrepo/
bzr push my:mybranch
bzr push my:otherbranch
bzr push my:anotherbranch

...instead of...

bzr push sftp://[email protected]/home/myuser/myrepo/mybranch
bzr push sftp://[email protected]/home/myuser/myrepo/otherbranch
bzr push sftp://[email protected]/home/myuser/myrepo/anotherbranch

...that is a pain in the ass.

I readed about bazaar.conf but it seems only able you to set a globals push locations for each branch/repo. Another way I saw is to use alias, but has the same problem, is very ugly when is needed to create new branches.

Is posible to do this without modify the BZR code? This should be obvious...

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

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

发布评论

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

评论(2

奢华的一滴泪 2024-08-22 11:56:00

my:xxx 语法在 bzr 中称为目录服务。您可以通过插件定义自己的目录服务(用Python编写)。

此类插件的一个很好的例子是书签插件。检查一下。

也许这个插件本身就足以满足您的需求。

The my:xxx syntax called directory services in bzr. You can define your own directory service via plugin (write in Python).

Good example of such plugins is bookmark plugin. Check it.

Maybe this plugin itself will be enough for your needs.

青丝拂面 2024-08-22 11:56:00

解决方案是将 bzr-bookmark 插件安装为 ~/.bazaar/plugins/bookmarks,然后:

bzr bookmark my sftp://[email protected]/home/myuser/myrepo/
bzr push bm:my/mybranch
bzr push bm:my/otherbranch
bzr push bm:my/anotherbranch

The solution is install bzr-bookmark plugin as ~/.bazaar/plugins/bookmarks, then:

bzr bookmark my sftp://[email protected]/home/myuser/myrepo/
bzr push bm:my/mybranch
bzr push bm:my/otherbranch
bzr push bm:my/anotherbranch
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文