Re: [viewvc-dev] [PATCH] issue #441: Allow "rNNN" formatting for Subversion revision specifiers

"C. Michael Pilato" <[email protected]> Thu, 17 Jun 2010 16:53:00 -0400
Newsgroups gmane.comp.version-control.cvs.viewcvs.devel
Organization CollabNet, Inc.
Message-ID <[email protected]>
> Index: lib/vclib/svn/svn_repos.py
> ===================================================================
> --- lib/vclib/svn/svn_repos.py	(revision 2402)
> +++ lib/vclib/svn/svn_repos.py	(working copy)
> @@ -727,6 +727,8 @@ class LocalSubversionRepository(vclib.Repository):
>      if rev is None or rev == 'HEAD':
>        return self.youngest
>      try:
> +      if type(rev) == type(''):
> +        rev = re.sub('^r*', '', rev)

I went a different route here:

     if type(rev) == type('') and rev[0] == 'r':
       rev = rev[1:]

(And did the same in the identical area of svn_ra.py.)

> Index: lib/viewvc.py
> ===================================================================
> --- lib/viewvc.py	(revision 2402)
> +++ lib/viewvc.py	(working copy)
> @@ -658,7 +658,7 @@ _re_validate_number = re.compile('^[0-9]+$')
>  _re_validate_boolint = re.compile('^[01]$')
>  
>  # when comparing two revs, we sometimes construct REV:SYMBOL, so ':' is needed
> -_re_validate_revnum = re.compile('^[-_.a-zA-Z0-9:~\\[\\]/]*$')
> +_re_validate_revnum = re.compile('^r?[-_.a-zA-Z0-9:~\\[\\]/]*$')

And as noted previously, this change is unnecessary because the 'r' is
already covered by the "a-z" portion of the preexisting regexp.

Committed the tweaked patch in r2405.  Not sure if I can backport to 1.1.x
as it technically is a change to the URL syntax.  Will think on these things.

-- 
C. Michael Pilato <[email protected]>
CollabNet   <>   www.collab.net   <>   Distributed Development On Demand

------------------------------------------------------
http://viewvc.tigris.org/ds/viewMessage.do?dsForumId=4251&dsMessageId=2623168

To unsubscribe from this discussion, e-mail: [[email protected]].
signature.asc (application/pgp-signature, 197 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkwaiywACgkQokEGqRcG/W6XIgCgzrs8gpKrZGsNNa3uhvZ4MX9K
BuoAn0BCVwmRpKA3rfR2wokXRkrWpDTx
=K73O
-----END PGP SIGNATURE-----