1

I would like to be able to set/get some custom attributes related to a working tree in bzr. These attributes could be used when I would start a build of the source in a particular working tree. For example, our software uses a PostgreSQL DB instance, and each Build (within a working tree/branch) needs to be able to 'know' which DB instance it relates to by name/host/port: DevDB, StableDB, StableRev010DB etc...

I don't want to put any of these attributes in a file under bzr's control. I already have made a custom 'make_branch.py' script which is able to make a working tree/branch from a source URL, and would like to add some options to be able to set these custom attributes when a making a new branch with my script.

Does anyone have suggestions? Bzrlib documentation is very thorough, but I can't seem to pinpoint how this could be achieved through the current API.

1 Answers1

1

Why not store your meta data in files and mark those files ignored using bzr ignore or editing .bzrignore? If that is not suitable for you, please explain why.

As per storing some kind of unversioned attributes, the closest thing I've seen to that was in the bzr-svn documentation: http://doc.bazaar.canonical.com/migration/en/foreign/bzr-on-svn-projects.html#versioned-properties

Subversion has a concept of versioned properties that is not currently present in Bazaar. This means bzr-svn cannot set any versioned properties, such as: svn:keywords, svn:eol-style, and svn:mime-type.

bzr-svn, will however, preserve versioned properties that are already present on the files.

That is, there are no versioned properties in Bazaar, but that's fine because you don't want to version them anyway. The plugin preserves a lot of Subversion meta data, so indeed there must be API methods for that. However, even though these meta data are not versioned, they are still stored inside the repository, which again is not what you want.

I haven't read all the API docs, but did the user guide, and there is definitely no mention of the functionality you are looking for. That said, Bazaar is very extensible, so maybe there is a way using the API.

I recommend to ask around on the IRC channel #bzr on irc.freenode.net. You could also try to search in the IRC logs at http://irclogs.ubuntu.com

janos
  • 120,954
  • 29
  • 226
  • 236
  • I know the functionality does not exist, that is why I mention bzrlib in my question. The bzrlib API is very big, and sifting through it is quite arduous. But as you mention, I could use an 'unversioned' file although I thought bzr was extensible as to allow implementing the solution I was first considering. – user2095877 Feb 21 '13 at 23:49
  • O I see you are willing to go further down the rabbit hole. Ok I updated the answer with more details. If you want to extend Bazaar, you have to implement a plugin, but the documentation is not great on that. I have written a guide that is much better. I cannot post it publicly but I can share with you privately if you are interested. – janos Feb 22 '13 at 07:21
  • Would really like to see your plugin documentation. Thanks! – user2095877 Feb 22 '13 at 16:18
  • If you give me a way to send it to you, I will. I cannot make it public, as it will be part of a book. – janos Apr 12 '13 at 05:58