using bzr with many small Python modules, forgetful person, and version numbers
John Arbash Meinel
john at arbash-meinel.com
Sun Dec 31 14:52:14 GMT 2006
Eric S. Johansson wrote:
> Jan Hudec wrote a very nice answer:
>> On Sat, Dec 30, 2006 at 06:49:45PM -0500, Eric S. Johansson wrote:
>>> short question: How can a forgetful person use bzr to track revisions
>>> of Python modules and simultaneously update the module version number
>>> automatically? (i.e. setup(...,version="1.10",...)) in setup.py)
> ...
>>
>> In bzr, there is only version for the whole tree. That is a feature.
>> In fact even you want it, because if the modules are more than one file
>> (as yours seem to be) you don't want to see change in one of them and
>> not the related change in the other.
>
> true. Looking over the current set of seven modules, all but one has
> two files, the code and set up.
You can do the opposite, and instead do:
bzr version-info --format=python --all > _version.py
This will generate the revno, and revision ids for all commits, as well
as the last modified information for every file.
In general, I subscribe to the 1-branch 1-project/library model, where
everything is versioned separately. It gives you nicer revision numbers,
and means you can create an explicit "this project/library version 1.0"
rather than having to mark all of the tree that way.
So you *could* build an all-branches version file, and then use the last
modified revision for a specific file in each branch.
I've used --all in a gui, which in "About" contains information so you
can see what exact revision it is, along with what revisions have been
merged in.
The only thing I remember is that '--all' still only gives the mainline
history, rather than giving any merged revisions. It might be better if
'--all' gave the full ancestry. (--all is also just a shortcut for
--check-clean --include-history --include-file-revisions, so you can
filter it slightly differently if you want)
John
=:->
More information about the bazaar
mailing list