1. ZyX_I
  2. aurum


ZyX_I  committed 55a792d

Consistency change: use bang instead of “force” option

  • Participants
  • Parent commits 71edaf0
  • Branches default
  • Tags release-1.2.1

Comments (0)

Files changed (4)

File README.markdown

View file
  • Ignore whitespace
 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#line348-0)).
+  - Partially committing changes ([:AuRecord](http://vimpluginloader.sourceforge.net/doc/aurum.txt.html#line347-0)).
-  - Viewing file state at particular revision ([aurum://file](http://vimpluginloader.sourceforge.net/doc/aurum.txt.html#line579-0), [:AuFile](http://vimpluginloader.sourceforge.net/doc/aurum.txt.html#line153-0)).
+  - Viewing file state at particular revision ([aurum://file](http://vimpluginloader.sourceforge.net/doc/aurum.txt.html#line578-0), [:AuFile](http://vimpluginloader.sourceforge.net/doc/aurum.txt.html#line153-0)).
   - Viewing uncommited changes in a vimdiff, as well as changes between 
-    specific revisions ([:AuVimDiff](http://vimpluginloader.sourceforge.net/doc/aurum.txt.html#line388-0)). It is also possible to open multiple 
+    specific revisions ([:AuVimDiff](http://vimpluginloader.sourceforge.net/doc/aurum.txt.html#line387-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#line233-0)). Output is highly customizable.
-  - Viewing working directory status ([:AuStatus](http://vimpluginloader.sourceforge.net/doc/aurum.txt.html#line352-0)).
+  - Viewing working directory status ([:AuStatus](http://vimpluginloader.sourceforge.net/doc/aurum.txt.html#line351-0)).
   - Commiting changes ([:AuCommit](http://vimpluginloader.sourceforge.net/doc/aurum.txt.html#line94-0)), commit messages are remembered in case of 
-    rollback ([g:aurum_remembermsg](http://vimpluginloader.sourceforge.net/doc/aurum.txt.html#line824-0)).
+    rollback ([g:aurum_remembermsg](http://vimpluginloader.sourceforge.net/doc/aurum.txt.html#line823-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 
   - 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#line721-0)), 
+Most commands can be reached with a set of mappings (see [aurum-mappings](http://vimpluginloader.sourceforge.net/doc/aurum.txt.html#line720-0)), 
 all mappings are customizable.

File doc/aurum.txt

View file
  • Ignore whitespace
     Note: you must either be at repository root (see |:cd|) or have all 
           arguments look like “path/to/repository/{meaningfulPart}”.
-AuName {name} {opts} [{rev}]                                         *:AuName*
+AuName[!] {name} {opts} [{rev}]                                      *:AuName*
     Name (tag/bookmark/...) revision {rev} (default: working directory 
-    revision) as {name}. Possible options:
+    revision) as {name}. If bang is given, then force naming even if {name} 
+    already exists. Possible options:
     Option      Description ~
     type        String, determines what will be done. Depends on repository 
                 object, for mercurial repositories it will be likely “tag” or 
                 Default: first item present in |aurum-repo.labeltypes|.
     [no]delete  Flag. If enabled, then {rev} argument will be ignored and 
                 tag/bookmark/... will be deleted. Default: disabled.
-    [no]force   Flag. If enabled, given revision will be named even if another 
-                revision has the same name. Default: disabled.
     [no]local   Flag. If enabled, then name will not be pushed.
                 Default: disabled.
     repo        Path. Repository that should be operated upon.

File plugin/aurum.vim

View file
  • Ignore whitespace
     " TODO improve files completion
     " TODO :AuMerge ?
     " TODO :AuExplore
-    let s:addargs={'Update': {'bang': 1}, 'Move': {'bang': 1}}
+    let s:addargs={'Update': {'bang': 1}, 'Move': {'bang': 1},
+                \    'Name': {'bang': 1}}
     for s:cmd in ['Update', 'Move', 'Junk', 'Track', 'Hyperlink', 'Grep',
                 \ 'Branch', 'Name']
         let s:part=tolower(s:cmd[:3])
             \           '}', 'filter']
 call add(s:brancomp, s:branfunc['@FWC'][0])
 "▶1 namefunc
-function s:namefunc.function(name, opts, ...)
+function s:namefunc.function(bang, name, opts, ...)
     let repo=s:_r.repo.get(a:opts.repo)
     call s:_r.cmdutils.checkrepo(repo)
     if !has_key(repo, 'labeltypes') || empty(repo.labeltypes)
         let type=repo.labeltypes[0]
-    let force=get(a:opts, 'force', 0)
+    let force=a:bang
     if rev isnot 0 && !force
             let labels=repo.functions.getrepoprop(repo, type.'slist')
     call repo.functions.label(repo, type, a:name, rev, force,
                 \             get(a:opts, 'local', 0))
-let s:namefunc['@FWC']=['-onlystrings '.
+let s:namefunc['@FWC']=['-onlystrings _ '.
             \           'type ""'.
             \           '{  repo '.s:_r.cmdutils.nogetrepoarg.
             \           ' ? type   type ""'.
             \           ' ?!delete'.
             \           ' ?!local'.
-            \           ' ?!force'.
             \           '} '.
             \           '+ type ""', 'filter']
 call add(s:namecomp, s:namefunc['@FWC'][0])

File test/name.in

View file
  • Ignore whitespace
 :R silent AuName D
 :W{{{1 force D
-:R silent AuName D force
+:R silent AuName! D
 :W{{{1 type E
 :R silent AuName E type t