using bzr with many small Python modules, forgetful person, and version numbers
bulb at ucw.cz
Sun Dec 31 09:56:55 GMT 2006
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)
> longer explanation: I have been scratching my head about how to organize
> modules with bzr. when I develop Python programs, I find myself
> creating small utility modules that stand alone. These modules are
> typically two or three files in size and rarely larger than five or six
> files. Originally I started storing them all in one repository/branch.
> This works okay except for the fact that I find myself forgetting to
> update version numbers. When I started looking at ways of automatically
> updating the module version number (i.e. version-info --format=python) I
> find myself in a position where bzr appears to be unable to
> differentiate between the individual module versions. Yes, I am aware
> that there is a difference between the current version of the repository
> and the version of the module.
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.
> if the answer is move the modules and make it one module per
> repository/branch, how does one split up an existing repository.
Yes, it indeed is. Make a branch for each module and delete all but that
module in that branch.
> Also a related question, how does one make multiple repositories
> available via the built-in server?
> Your guidance is most appreciated.
IIRC (but I never actually used it), the builtin server provides access
to it's working directory *and below*. Therefore if you run it from a
directory where the branches you want to serve are subdirectories, it
should allow access to all of them. Ie. if you have a directory
containing subdirs 'a' and 'b', which are branches, and run a 'bzr
serve' there, you should be able to access them as 'bzr://host:port/a'
and 'bzr://host:port/b' respectively.
You can also use the server through ssh (the bzr+ssh: protocol), which
has the advantage that ssh provides authentication. There the server
will be automatically run in the directory you want.
- Jan Hudec `Bulb' <bulb at ucw.cz>
More information about the bazaar