Commits

abudden committed ab7509a

Add version information to debug output (fixes #224).

Comments (0)

Files changed (7)

autoload/TagHighlight/Generation.vim

 let g:loaded_TagHLGeneration = 1
 
 function! TagHighlight#Generation#UpdateTypesFile(recurse, skiptags)
+	" Load the version information if we haven't already
+	call TagHighlight#Version#LoadVersionInfo()
+	call TagHLDebug("Release Info:" . string(g:TagHighlightPrivate['PluginVersion']), "Information")
+	
+	" Load the option file
 	let option_file_info = TagHighlight#Option#LoadOptionFileIfPresent()
-	" Initial very simple implementation
 	
 	" Call any PreUpdate hooks
 	let preupdate_hooks = TagHighlight#Option#GetOption('PreUpdateHooks')

autoload/TagHighlight/Version.vim

+" Tag Highlighter:
+"   Author:  A. S. Budden <abudden _at_ gmail _dot_ com>
+"   Date:    05/08/2011
+" Copyright: Copyright (C) 2009-2011 A. S. Budden
+"            Permission is hereby granted to use and distribute this code,
+"            with or without modifications, provided that this copyright
+"            notice is copied with it. Like anything else that's free,
+"            the TagHighlight plugin is provided *as is* and comes with no
+"            warranty of any kind, either expressed or implied. By using
+"            this plugin, you agree that in no event will the copyright
+"            holder be liable for any damages resulting from the use
+"            of this software.
+
+" ---------------------------------------------------------------------
+try
+	if &cp || (exists('g:loaded_TagHLVersion') && (g:plugin_development_mode != 1))
+		throw "Already loaded"
+	endif
+catch
+	finish
+endtry
+let g:loaded_TagHLVersion = 1
+
+function! TagHighlight#Version#LoadVersionInfo()
+	if has_key(g:TagHighlightPrivate, 'PluginVersion')
+		return
+	endif
+
+	let g:TagHighlightPrivate['PluginVersion'] = {}
+	
+	let last_release_info = TagHighlight#LoadDataFile#LoadDataFile('release.txt')
+	let g:TagHighlightPrivate['PluginVersion']['LastRelease'] = last_release_info['release']
+
+	try
+		let release_version_info = TagHighlight#LoadDataFile#LoadDataFile('version_info.txt')
+		let g:TagHighlightPrivate['PluginVersion']['VersionInfo'] = release_version_info
+	catch /^Vim\%((\a\+)\)\=:E484/
+		" Not a release version
+		let g:TagHighlightPrivate['PluginVersion']['VersionInfo'] =
+					\ {
+					\    'release_clean': 'N/A',
+					\    'release_date': 'N/A',
+					\    'release_revno': 'N/A',
+					\    'release_revid': 'N/A'
+					\ }
+	endtry
+endfunction

doc/TagHighlight.txt

 2.0.14: 5th August 2011    : Bug fix for selection of source directory.  If
                              one of the explicit locations was set to 'None',
                              it was using 'None' as the source dir location.
+                             Added version information printing to debug
+                             output.
 
 2.0.13: 4th August 2011    : Improvements to directory searching (mainly for
                              Cygwin).  Addition of option to include timestamp

plugin/TagHighlight/module/__init__.py

 #            of this software.
 
 # ---------------------------------------------------------------------
-from .version import revtag, datetag
-
-revision = revtag.strip('# ').replace('RevTag:: ', '')
-date = datetag.strip('# ').replace('Date:: ', '')

plugin/TagHighlight/module/cmd.py

 
 from .config import SetInitialOptions, LoadLanguages
 from .options import AllOptions
-from . import revision
 
 def ProcessCommandLine():
-    parser = optparse.OptionParser(version=("Tag Highlight Types File Creator (revision %%prog) {0}".format(revision)))
+    parser = optparse.OptionParser()
 
     for dest in AllOptions.keys():
         if 'CommandLineSwitches' not in AllOptions[dest]:

plugin/TagHighlight/module/version.py

-#!/usr/bin/env python
-# Tag Highlighter:
-#   Author:  A. S. Budden <abudden _at_ gmail _dot_ com>
-#   Date:    25/07/2011
-# Copyright: Copyright (C) 2009-2011 A. S. Budden
-#            Permission is hereby granted to use and distribute this code,
-#            with or without modifications, provided that this copyright
-#            notice is copied with it. Like anything else that's free,
-#            the TagHighlight plugin is provided *as is* and comes with no
-#            warranty of any kind, either expressed or implied. By using
-#            this plugin, you agree that in no event will the copyright
-#            holder be liable for any damages resulting from the use
-#            of this software.
-
-# ---------------------------------------------------------------------
-revtag = "## RevTag:: r560 ##".strip('# ').replace('RevTag::', 'revision')
-datetag = "## Date:: 26th July 2011 ##".strip('# ').replace('Date:: ', '')

plugin/TagHighlight/module/worker.py

 #!/usr/bin/env python
 # Tag Highlighter:
 #   Author:  A. S. Budden <abudden _at_ gmail _dot_ com>
-#   Date:    27/07/2011
+#   Date:    05/08/2011
 # Copyright: Copyright (C) 2009-2011 A. S. Budden
 #            Permission is hereby granted to use and distribute this code,
 #            with or without modifications, provided that this copyright
 
 def RunWithOptions(options):
     from .config import config, SetInitialOptions, LoadLanguages
+    from .debug import Debug
 
     SetInitialOptions(options)
 
-    if config['debug_level'] == 'Information':
-        print("Running types highlighter generator")
+    Debug("Running types highlighter generator", "Information")
+    Debug("Release:" + config['release'], "Information")
+    Debug("Version:" + repr(config['version']), "Information")
 
     if config['use_existing_tagfile'] and not os.path.exists(config['ctags_file']):
         config['use_existing_tagfile'] = False
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.