Allowing "r" in revisions, like r12345

James Westby jw+debian at jameswestby.net
Thu Mar 13 09:28:58 GMT 2008


On Thu, 2008-03-13 at 09:23 +0200, Jari Aalto wrote:
> The "r" in SVN has been used to indicate a change point:
> 
>     * code.cc: (NetworkConnections): Fix for-loop to read the stream.
>     This fixes bug #12345 and was caused by error in commit r321.
> 
> Likewise in bug reports:
> 
>     Fix released in r321
> 
> In bzr we would have to use different notation:
> 
>     ... in revno 321.
> 
> SUGGESTION:
> 
> It would be handy if the word "rNNNN", would be also a valid revision
> token:
> 
>     bzr diff -r r321..
> 
> Could bzr simply ignore the leading "r" and use the NNNN, if the
> revision would look like
> 
>     /r([0-9]+)\b/
> 

The code that needs to be modified is in bzrlib/revisionspec.py

            global _revno_regex
            if _revno_regex is None:
                _revno_regex = re.compile(r'^(?:(\d+(\.\d+)*)|-\
+)(:.*)?$')  
            if _revno_regex.match(spec) is not None:
                return RevisionSpec_revno(spec, _internal=True)

It should be quite straightforward to change this regex and
add some tests for it in bzrlib/tests/test_revisionnamespaces.py
and bzrlib/tests/blackbox/test_log.py or similar.

Thanks,

James






More information about the bazaar mailing list