stable: merge with default stable
authorChristian Ebert <blacktrash@gmx.net>
Wed, 26 Jan 2011 17:49:11 +0000
branchstable
changeset 876 20db7f6aba9a
parent 872 67aaf09289bb (current diff)
parent 875 e01f1b4a62e9 (diff)
child 877 c2ca6e172fd8
stable: merge with default
--- a/hgkw/keyword.py	Sat Dec 11 12:49:10 2010 +0100
+++ b/hgkw/keyword.py	Wed Jan 26 17:49:11 2011 +0000
@@ -70,9 +70,8 @@
 replaced with customized keywords and templates. Again, run
 :hg:`kwdemo` to control the results of your configuration changes.
 
-Before changing/disabling active keywords, run :hg:`kwshrink` to avoid
-the risk of inadvertently storing expanded keywords in the change
-history.
+Before changing/disabling active keywords, you must run :hg:`kwshrink`
+to avoid storing expanded keywords in the change history.
 
 To force expansion after enabling it, or a configuration change, run
 :hg:`kwexpand`.
@@ -356,6 +355,9 @@
     ui.note(_('creating temporary repository at %s\n') % tmpdir)
     repo = localrepo.localrepository(ui, tmpdir, True)
     ui.setconfig('keyword', fn, '')
+    svn = ui.configbool('keywordset', 'svn')
+    # explicitly set keywordset for demo output
+    ui.setconfig('keywordset', 'svn', svn)
 
     uikwmaps = ui.configitems('keywordmaps')
     if args or opts.get('rcfile'):
@@ -363,7 +365,10 @@
         if uikwmaps:
             ui.status(_('\textending current template maps\n'))
         if opts.get('default') or not uikwmaps:
-            ui.status(_('\toverriding default template maps\n'))
+            if svn:
+                ui.status(_('\toverriding default svn keywordset\n'))
+            else:
+                ui.status(_('\toverriding default cvs keywordset\n'))
         if opts.get('rcfile'):
             ui.readconfig(opts.get('rcfile'))
         if args:
@@ -375,7 +380,10 @@
             ui.readconfig(repo.join('hgrc'))
         kwmaps = dict(ui.configitems('keywordmaps'))
     elif opts.get('default'):
-        ui.status(_('\n\tconfiguration using default keyword template maps\n'))
+        if svn:
+            ui.status(_('\n\tconfiguration using default svn keywordset\n'))
+        else:
+            ui.status(_('\n\tconfiguration using default cvs keywordset\n'))
         kwmaps = _defaultkwmaps(ui)
         if uikwmaps:
             ui.status(_('\tdisabling current template maps\n'))
@@ -389,6 +397,7 @@
     reposetup(ui, repo)
     ui.write('[extensions]\nkeyword =\n')
     demoitems('keyword', ui.configitems('keyword'))
+    demoitems('keywordset', ui.configitems('keywordset'))
     demoitems('keywordmaps', kwmaps.iteritems())
     keywords = '$' + '$\n$'.join(sorted(kwmaps.keys())) + '$\n'
     repo.wopener(fn, 'w').write(keywords)
@@ -465,8 +474,7 @@
 def shrink(ui, repo, *pats, **opts):
     '''revert expanded keywords in the working directory
 
-    Run before changing/disabling active keywords or if you experience
-    problems with :hg:`import` or :hg:`merge`.
+    Must be run before changing/disabling active keywords.
 
     kwshrink refuses to run if given files contain local changes.
     '''
@@ -628,8 +636,6 @@
         finally:
             wlock.release()
 
-    repo.__class__ = kwrepo
-
     def kwfilectx_cmp(orig, self, fctx):
         # keyword affects data size, comparing wdir and filelog size does
         # not make sense
@@ -653,6 +659,8 @@
         except KeyError:
             pass
 
+    repo.__class__ = kwrepo
+
 cmdtable = {
     'kwdemo':
         (demo,
--- a/tests/test-keyword.t	Sat Dec 11 12:49:10 2010 +0100
+++ b/tests/test-keyword.t	Wed Jan 26 17:49:11 2011 +0000
@@ -17,6 +17,8 @@
   keyword =
   [keyword]
   demo.txt = 
+  [keywordset]
+  svn = False
   [keywordmaps]
   Author = {author|user}
   Date = {date|utcdate}
@@ -40,6 +42,8 @@
   keyword =
   [keyword]
   demo.txt = 
+  [keywordset]
+  svn = False
   [keywordmaps]
   Branch = {branches}
   $Branch: demobranch $
@@ -633,6 +637,8 @@
   b = ignore
   demo.txt = 
   i = ignore
+  [keywordset]
+  svn = False
   [keywordmaps]
   Xinfo = {author}: {desc}
   $Xinfo: test: hg keyword configuration and expansion example $