[PATCH 1 of 1] keyword: use os.sep in default keywordmaps

Patrick Mézard pmezard at gmail.com
Mon Feb 8 14:50:57 CST 2010


Le 08/02/10 15:13, Christian Ebert a écrit :
> # HG changeset patch
> # User Kevin O. Grover <kevin at kevingrover.net>
> # Date 1265638286 -3600
> # Node ID eafc7976c686b9161e9336d5db20e61f33de47c7
> # Parent  935ef1836b2f6172c1b003fa751a5b327a9bae7e
> keyword: use os.sep in default keywordmaps
> 
> diff --git a/hgext/keyword.py b/hgext/keyword.py
> --- a/hgext/keyword.py
> +++ b/hgext/keyword.py
> @@ -82,7 +82,7 @@
>  from mercurial.lock import release
>  from mercurial.node import nullid
>  from mercurial.i18n import _
> -import re, shutil, tempfile
> +import os, re, shutil, tempfile
>  
>  commands.optionalrepo += ' kwdemo'
>  
> @@ -115,9 +115,10 @@
>          'RCSfile': '{file|basename},v',
>          'RCSFile': '{file|basename},v', # kept for backwards compatibility
>                                          # with hg-keyword
> -        'Source': '{root}/{file},v',
> +        'Source': '{root}%s{file},v' % os.sep,
>          'Id': '{file|basename},v {node|short} {date|utcdate} {author|user}',
> -        'Header': '{root}/{file},v {node|short} {date|utcdate} {author|user}',
> +        'Header': '{root}%s{file},v {node|short} {date|utcdate} {author|user}'
> +                  % os.sep,
>      }
>  
>      def __init__(self, ui, repo):

Is that how it works in CVS world or how we would like it worked? I don't have the time to learn how to use CVS keywords under windows but the only web page with substitution samples shows paths with slashes in them, not backslashes:

    http://www.mobilefish.com/developer/cvsnt/cvsnt_quickguide_cvskeywords.html

--
Patrick Mézard


More information about the Mercurial-devel mailing list