Ability to update a file's modification time to the revision time?

Martin Pool mbp at canonical.com
Thu Jun 19 03:27:29 BST 2008


On Mon, Jun 16, 2008 at 7:01 AM, Brian de Alwis <bsd at cs.ubc.ca> wrote:
> I've had two occasions recently where I was looking for a way to embed the
> revno of the current branch in a particular file (once for a LaTeX document,
> the other for a source distribution).  In particular, I was seeking a way to
> output the revno as part of a formatted string to a particular file (e.g.,
> "(rev {0})" or 'char revision[] = "rev {0}";' where {0} would be replaced by
> the revno) with the file's modification time set to the commit date of this
> revision.  By updating the modification times, I could update this file on
> each build but avoid rebuilding the document if the revno hasn't changed.
>
> My apologies if there a way to do this, but I didn't see anything in the
> plugin list or in bzr revno or revision-info.

I don't think there is anything to do it at the moment.  You could
probably script it from a makefile (or a bzr plugin); if doing it from
an external file you could parse the bzr revision-info output.  In
fact, bzr revision-info may be able to just update your file directly.
 Or see Ian's recent list posts about id tags in files.

-- 
Martin <http://launchpad.net/~mbp/>



More information about the bazaar mailing list