jkunstle / rpms / vim

Forked from rpms/vim 3 years ago
Clone
867a71
--- vim70/runtime/ftplugin/spec.vim.rh1	2006-05-10 19:37:45.000000000 +0200
867a71
+++ vim70/runtime/ftplugin/spec.vim	2006-11-13 12:21:32.000000000 +0100
867a71
@@ -18,11 +18,18 @@
867a71
 
867a71
 if !exists("*s:SpecChangelog")
867a71
 	function s:SpecChangelog(format)
867a71
+        let save_time = v:lc_time
867a71
 		if strlen(a:format) == 0
867a71
 			if !exists("g:spec_chglog_format")
867a71
-				let email = input("Email address: ")
867a71
-				let g:spec_chglog_format = "%a %b %d %Y " . l:email
867a71
-				echo "\r"
867a71
+                if !exists("g:packager")
867a71
+                    let email = input("Email address: ")
867a71
+                    let g:spec_chglog_format = "%a %b %d %Y " . l:email
867a71
+                    echo "\r"
867a71
+                else
867a71
+                    let email = g:packager
867a71
+                    let g:spec_chglog_format = "%a %b %d %Y " . l:email
867a71
+                    echo "\r"
867a71
+                endif
867a71
 			endif
867a71
 			let format = g:spec_chglog_format
867a71
 		else
867a71
@@ -58,7 +65,7 @@
867a71
 			let line = line+1
867a71
 		endwhile
867a71
 		if (nameline != -1 && verline != -1 && relline != -1)
867a71
-			let include_release_info = exists("g:spec_chglog_release_info")
867a71
+			let include_release_info = 1
867a71
 			let name = s:ParseRpmVars(name, nameline)
867a71
 			let ver = s:ParseRpmVars(ver, verline)
867a71
 			let rel = s:ParseRpmVars(rel, relline)
867a71
@@ -79,8 +86,10 @@
867a71
 			endif
867a71
 		endif
867a71
 		if (chgline != -1)
867a71
+            execute "language time C"
867a71
 			let parsed_format = "* ".strftime(format)
867a71
-			let release_info = "+ ".name."-".ver."-".rel
867a71
+            execute "language time " . save_time
867a71
+			let release_info = ver."-".rel
867a71
 			let wrong_format = 0
867a71
 			let wrong_release = 0
867a71
 			let insert_line = 0
867a71
@@ -97,15 +106,14 @@
867a71
 						execute relline
867a71
 						normal ?
867a71
 						let rel = substitute(strpart(getline(relline),8), '^[	 ]*\([^ 	]\+\)[		]*$','\1','')
867a71
-						let release_info = "+ ".name."-".ver."-".rel
867a71
+						let release_info = ver."-".rel
867a71
 					endif
867a71
 				endif
867a71
 				let n = 0
867a71
-				call append(chgline+n, parsed_format)
867a71
 				if include_release_info
867a71
-					let n = n + 1
867a71
-					call append(chgline+n, release_info)
867a71
+                    let parsed_format = parsed_format." ".release_info
867a71
 				endif
867a71
+				call append(chgline+n, parsed_format)
867a71
 				let n = n + 1
867a71
 				call append(chgline+n,"- ")
867a71
 				let n = n + 1