views:

110

answers:

2

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...

+6  A: 

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.

bialix
Work great thanks! but this should be installed by default. I cannot vote up you... yet (note the indirect)
mkotechno
+5  A: 

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
mkotechno