Commits

ZyX_I committed ef2926d

Added support for unknown sites that use hgweb: by analyzing page source code (requires them not change icon name and its location under static/)

Comments (0)

Files changed (4)

 This plugin provides a vim <--> VCS (currently only mercurial) integration for 
 your projects. Features:
 
-  - Partially committing changes ([:AuRecord](http://vimpluginloader.sourceforge.net/doc/aurum.txt.html#line325-0)).
+  - Partially committing changes ([:AuRecord](http://vimpluginloader.sourceforge.net/doc/aurum.txt.html#line327-0)).
 
-  - Viewing file state at particular revision ([aurum://file](http://vimpluginloader.sourceforge.net/doc/aurum.txt.html#line556-0), [:AuFile](http://vimpluginloader.sourceforge.net/doc/aurum.txt.html#line146-0)).
+  - Viewing file state at particular revision ([aurum://file](http://vimpluginloader.sourceforge.net/doc/aurum.txt.html#line558-0), [:AuFile](http://vimpluginloader.sourceforge.net/doc/aurum.txt.html#line148-0)).
 
   - Viewing uncommited changes in a vimdiff, as well as changes between 
-    specific revisions ([:AuVimDiff](http://vimpluginloader.sourceforge.net/doc/aurum.txt.html#line365-0)). It is also possible to open multiple 
+    specific revisions ([:AuVimDiff](http://vimpluginloader.sourceforge.net/doc/aurum.txt.html#line367-0)). It is also possible to open multiple 
     tabs with all changes to all files viewed as side-by-side diffs.
 
-  - Viewing revisions log ([:AuLog](http://vimpluginloader.sourceforge.net/doc/aurum.txt.html#line226-0)). Output is highly customizable.
+  - Viewing revisions log ([:AuLog](http://vimpluginloader.sourceforge.net/doc/aurum.txt.html#line228-0)). Output is highly customizable.
 
-  - Viewing working directory status ([:AuStatus](http://vimpluginloader.sourceforge.net/doc/aurum.txt.html#line329-0)).
+  - Viewing working directory status ([:AuStatus](http://vimpluginloader.sourceforge.net/doc/aurum.txt.html#line331-0)).
 
-  - Commiting changes ([:AuCommit](http://vimpluginloader.sourceforge.net/doc/aurum.txt.html#line87-0)), commit messages are remembered in case of 
-    rollback ([g:aurum_remembermsg](http://vimpluginloader.sourceforge.net/doc/aurum.txt.html#line801-0)).
+  - Commiting changes ([:AuCommit](http://vimpluginloader.sourceforge.net/doc/aurum.txt.html#line89-0)), commit messages are remembered in case of 
+    rollback ([g:aurum_remembermsg](http://vimpluginloader.sourceforge.net/doc/aurum.txt.html#line803-0)).
 
   - Obtaining various URL’s out of remote repository URL (like URL of the HTML 
     version of the current file with URL fragment pointing to the current line 
-    attached: useful for sharing) ([:AuHyperlink](http://vimpluginloader.sourceforge.net/doc/aurum.txt.html#line177-0)).
+    attached: useful for sharing) ([:AuHyperlink](http://vimpluginloader.sourceforge.net/doc/aurum.txt.html#line179-0)).
 
-  - Frontends for various VCS commands.
+  - aurum#changeset(), aurum#repository() and aurum#status() functions 
+    that are to be used from modeline.
 
-Most commands can be reached with a set of mappings (see [aurum-mappings](http://vimpluginloader.sourceforge.net/doc/aurum.txt.html#line698-0)), 
+  - Frontends for various other VCS commands.
+
+Most commands can be reached with a set of mappings (see [aurum-mappings](http://vimpluginloader.sourceforge.net/doc/aurum.txt.html#line700-0)), 
 all mappings are customizable.
 
 

aurum-addon-info.txt

         "python": "|| ( app-editors/vim[python] app-editors/gvim[python] )",
     },
     "use_help_for_vimorg": 1,
+    "wiki_pages": {"moinmoin": ["http://www.mercurial-scm.org/wiki/Aurum"]},
     "scriptnumber": 3828,
     "files": [
         "autoload/aurum.vim",
   - Obtaining various URL’s out of remote repository URL (like URL of the HTML 
     version of the current file with URL fragment pointing to the current line 
     attached: useful for sharing) (|:AuHyperlink|).
-  - Frontends for various VCS commands.
+  - |aurum#changeset()|, |aurum#repository()| and |aurum#status()| functions 
+    that are to be used from modeline.
+  - Frontends for various other VCS commands.
 Most commands can be reached with a set of mappings (see |aurum-mappings|), 
 all mappings are customizable.
 

plugin/aurum/drivers/mercurial.vim

             \        '"default/master")[8:])'.
             \':'.
             \   '("master")))'
-let s:hypsites=[
-\['domain is? "bitbucket.org"',
-\ {     'html': '"https://".domain.path."/src/".cs.hex."/".file',      'hline': '"cl-".line',
+let s:dport='domain.(empty(port)?"":":".port)'
+let s:link='shellescape("http://".'.s:dport.'.path)'
+" TODO cache
+let s:dl=    '(executable("curl")?'.
+            \   '(system("curl -L ".'.s:link.')):'.
+            \'(executable("wget")?'.
+            \   '(system("wget -O- ".'.s:link.'))'.
+            \':'.
+            \   '(0)))'
+unlet s:link
+let s:bbdict={
+\       'html': '"https://".domain.path."/src/".cs.hex."/".file',      'hline': '"cl-".line',
 \        'raw': '"https://".domain.path."/raw/".cs.hex."/".file',
 \   'annotate': '"https://".domain.path."/annotate/".cs.hex."/".file', 'aline': '"line-".line',
 \   'filehist': '"https://".domain.path."/history/".file',
 \  'changeset': '"https://".domain.path."/changeset/".cs.hex',
 \        'log': '"https://".domain.path."/changesets"',
 \      'clone': '"https://".domain.path',
-\       'push': '"ssh://hg@".domain.path',}],
+\       'push': '"ssh://hg@".domain.path',
+\}
+let s:hgwebdict={
+\       'html': '"http://".'.s:dport.'.path."/file/".cs.hex."/".file',     'hline': '"l".line',
+\        'raw': '"http://".'.s:dport.'.path."/raw-file/".cs.hex."/".file',
+\   'annotate': '"http://".'.s:dport.'.path."/annotate/".cs.hex."/".file', 'aline': '"l".line',
+\   'filehist': '"http://".'.s:dport.'.path."/log/".cs.hex."/".file',
+\  'changeset': '"http://".'.s:dport.'.path."/rev/".cs.hex',
+\        'log': '"http://".'.s:dport.'.path."/graph"',
+\      'clone': '"http://".'.s:dport.'.path',
+\}
+unlet s:dport
+let s:hypsites=[
+\['domain is? "bitbucket.org" && protocol[:2] is? "git"',
+\ map(copy(s:bbdict), 'substitute(v:val, "\\Vcs.hex", s:gb, "")')],
+\['domain is? "bitbucket.org"', s:bbdict],
 \['domain is? "github.com"',
 \ {     'html': '"https://".domain."/".'.s:ghpath.'."/blob/".'.s:gb.'."/".file',   'hline': '"L".line',
 \        'raw': '"https://".domain."/".'.s:ghpath.'."/raw/". '.s:gb.'."/".file',
 \      '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',}],
+\ map(copy(s:hgwebdict), 'substitute(v:val, "http", "https", "")')],
 \[ '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',
-\        'raw': '"http://".domain.path."/raw-file/".cs.hex."/".file',
-\   'annotate': '"http://".domain.path."/annotate/".cs.hex."/".file', 'aline': '"l".line',
-\   'filehist': '"http://".domain.path."/log/".cs.hex."/".file',
-\  'changeset': '"http://".domain.path."/rev/".cs.hex',
-\        'log': '"http://".domain.path."/graph"',
-\      'clone': '"http://".domain.path',}],
+\ '(domain is? "anonscm.debian.org" && path[:2] is? "/hg") || '.
+\ '('.s:dl.'=~#''\V<link rel="icon" href="\[^"]\*static/hgicon.png" type="image/png" />'')',
+\ s:hgwebdict],
 \]
-unlet s:ghpath s:gcproj s:cbssh s:cbhttps s:pkbase s:cpbase s:gb
+unlet s:ghpath s:gcproj s:cbssh s:cbhttps s:pkbase s:cpbase s:gb s:dl s:hgwebdict s:bbdict
 "▶1 removechangesets :: repo, start_rev_num → + repo
 function s:F.removechangesets(repo, start)
     let changesets=a:repo.changesets