Commits

ZyX_I  committed 212f813

Improved support for mercurial kenai and sharesource repositories

  • Participants
  • Parent commits d39be22

Comments (0)

Files changed (2)

File plugin/aurum.vim

 "▶1 Globals
 let s:_messages={
             \ 'invurl': 'Failed to parse url %s of repository %s',
-            \ 'unkurl': 'Failed to process url %s of repository %s',
+            \ 'uknurl': 'Failed to process url %s of repository %s',
             \ 'uunsup': 'Url type `%s'' is not supported for repository %s '.
             \           'linked with %s',
             \'nofiles': 'No files were specified',

File plugin/aurum/drivers/mercurial.vim

 "  https://mirrors.kilnhg.com/Repo/Mirrors/Hg/Mercurial
 "  http://hg.mozdev.org/maf/ / ssh://USER:PASS@hg.mozdev.org/maf
 "u https://projectkenai.com/hg/sonichg~test (rev numbers must match)
+"  https://hg.kenai.com/hg/sonichg~test / ssh://user@hg.kenai.com/sonichg~test
 "  http://hg.savannah.nongnu.org/hgweb/mechsys/
 "  https://sharesource.org/hg/alqua/
 "  http://mercurial.tuxfamily.org/mercurialroot/slitaz/tazlito/
 let s:ghpath='substitute(path, "\\v^[:/]|\\.git$", "", "g")'
 let s:gcproj='matchstr(domain, "\\v^[^.]+")'
+let s:pkbase='"http://".matchstr(domain, ''\v[^.]+\.[^.]+$'')."/projects/".matchstr(path, ''\v.*\/\zs[^~]+'').'.
+            \                                                '"/sources/". matchstr(path, "\\v[^~]+$")'
 let s:cbbase='"https://".%s.".".domain."/projects/".%s."/repositories/".%s'
 let s:cbssh=printf(s:cbbase, 'matchstr(path, "\\v^[^/]+", 1)',
             \                'matchstr(path, ''\v[^/]+%(\/[^/]+\/?$)'')',
 \['domain =~? "\\Vkilnhg.com\\$"',
 \ {  'html': '"http://".domain.path."/File/".file."?rev=".cs.hex',
 \    'hline': 'line'}],
-\['domain =~? "\\Vprojectkenai.com\\$" && path[:2] is? "/hg"',
-\ {  'html': '"http://projectkenai.com/projects/".matchstr(path, "\\v^[^~]+", 4).'.
-\                                   '"/sources/". matchstr(path, "\\v[^~]+$")."/content/".file.'.
-\                                 '"?rev=".cs.rev',}],
+\['domain =~? ''\V\%(project\)\?kenai.com\$'' && (path[:2] is? "/hg" || domain[:2] is? "hg.")',
+\ {     'html': s:pkbase.'."/content/".file."?rev=".cs.rev',
+\        'raw': s:pkbase.'."/content/".file."?raw=true&rev=".cs.rev',
+\   'filehist': s:pkbase.'."/history/".file',
+\  'changeset': s:pkbase.'."/revision/".cs.rev',
+\        'log': s:pkbase.'."/history"',
+\      'clone': '"https://".domain."/hg/".matchstr(path, "\\v[^/]+$")',
+\       'push': '"ssh://".domain."/".matchstr(path, "\\v[^/]+$")',}],
+\['domain is? "sharesource.org" && path[:2] is? "/hg"',
+\ {     'html': '"https://".domain.path."/file/".cs.hex."/".file',     'hline': '"l".line',
+\        'raw': '"https://".domain.path."/raw-file/".cs.hex."/".file',
+\   'annotate': '"https://".domain.path."/annotate/".cs.hex."/".file', 'aline': '"l".line',
+\   'filehist': '"https://".domain.path."/log/".cs.hex."/".file',
+\  'changeset': '"https://".domain.path."/rev/".cs.hex',
+\        'log': '"https://".domain.path."/graph"',
+\      'clone': '"https://".domain.path',}],
 \[ 'domain =~? ''\v^%(mercurial\.%(intuxication|tuxfamily)|hg\.mozdev|hg\.savannah\.%(non)?gnu)\.org$'' || '.
 \ '(domain is? "anonscm.debian.org" && path[:2] is? "/hg")',
 \ {     'html': '"http://".domain.path."/file/".cs.hex."/".file',     'hline': '"l".line',
 \  'changeset': '"http://".domain.path."/rev/".cs.hex',
 \        'log': '"http://".domain.path."/graph"',
 \      'clone': '"http://".domain.path',}],
-\['domain is? "sharesource.org" && path[:2] is? "/hg"',
-\ {  'html': '"https://".domain.path."/file/".cs.hex."/".file', 'hline': '"l".line'}],
 \]
 unlet s:ghpath s:gcproj s:cbssh s:cbhttps
 "▶1 removechangesets :: repo, start_rev_num → + repo