add per-branch (and per-repo?) bookmarks

Bug #254936 reported by Selene ToyKeeper
2
Affects Status Importance Assigned to Milestone
Bazaar Bookmarks Plugin
Fix Released
Undecided
Lukáš Lalinský

Bug Description

I often find myself wanting to add bookmarks on a per-branch or per-repo basis. For example, if I'm working on three different projects with someone named Fred, I would like to be able to run "bzr pull fred" in each one.

This is especially useful when working with svn repos via bzr, since bzr only remembers one set of URLs and bzr-svn involves at least two sets. For example, if I want to change a svn branch and publish changes to several places...

  # svn = svn+ssh://svn.example.com/project/trunk
  # lp = bzr+ssh://<email address hidden>/~myuser/project/trunk/
  # backup = bzr+ssh://myserver/project/trunk
  bzr pull lp
  bzr pull svn
  hack, commit, hack, commit, hack, commit
  bzr push svn
  bzr push lp
  bzr push backup

This is simplified; I run into cases regularly where I have more than three different URLs and use them for more than just push and pull. But I think it shows the basic idea well enough.

This is all just per-branch bookmarks so far. The primary issue I've run into where per-repo bookmarks would help is feature branching in svn. Since svn has no real concept of branches, the commits get flattened... and bzr-svn doesn't flatten them. It just commits the final merge. So, to commit each rev instead of just the merge, the resulting work flow is a bit messed up:

  /> bzr branch svn trunk
  /> bzr branch trunk myfeature
  /myfeature/> hack, commit, hack, commit
  /trunk/> bzr pull svn
  /myfeature/> bzr rebase ../trunk # if necessary
  /myfeature/> bzr push svn
  /trunk/> bzr pull svn

This approach feels wrong, but per-repo bookmarks would at least make it a bit easier.

Revision history for this message
Selene ToyKeeper (toykeeper) wrote :

It looks like this requires changing from GlobalConfig to branch.get_config(), but I don't yet know the details. I'll keep looking, but it may take a while.

Revision history for this message
Selene ToyKeeper (toykeeper) wrote :

One other use case I encounter is when I'm using both launchpad and my own bzr server... Sometimes I develop locally and push a mirror to launchpad; other times I develop using launchpad and keep a backup on my server. But, in either case, it would be nice to be able to do something like...

  bzr commit
  bzr push # local server
  bzr push lp

Instead, assuming I have "lp-myproject" bookmarks for each project, that last line becomes:

  bzr push bm:lp-myproject

If this was the project's main branch, I could just do 'bzr push lp:myproject' instead, so this makes the bookmark actually longer than the location it's bookmarking.

I also found per-repo bookmarks useful for an old mercurial-based project. The work flow there was something like:

  # get updates
  hg pull official-repo
  hg pull fred
  hg pull mary
  # review and merge
  hg merge
  # publish
  hg push my-public-repo
  hg push backup
  hg push official-repo # sometimes

Maybe this is unusual, but it's the sort of approach which could benefit from per-repo bookmarks.

Lukáš Lalinský (luks)
Changed in bzr-bookmarks:
assignee: nobody → luks
status: New → Fix Committed
Vincent Ladeuil (vila)
Changed in bzr-bookmarks:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.