ZyX_I committed 55a792d

Consistency change: use bang instead of “force” option

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

Comments (0)

Files changed (4)

 This plugin provides a vim <--> VCS (currently only mercurial) integration for 
 your projects. Features:
-  - Partially committing changes ([:AuRecord](
+  - Partially committing changes ([:AuRecord](
-  - Viewing file state at particular revision ([aurum://file](, [:AuFile](
+  - Viewing file state at particular revision ([aurum://file](, [:AuFile](
   - Viewing uncommited changes in a vimdiff, as well as changes between 
-    specific revisions ([:AuVimDiff]( It is also possible to open multiple 
+    specific revisions ([:AuVimDiff]( It is also possible to open multiple 
     tabs with all changes to all files viewed as side-by-side diffs.
   - Viewing revisions log ([:AuLog]( Output is highly customizable.
-  - Viewing working directory status ([:AuStatus](
+  - Viewing working directory status ([:AuStatus](
   - Commiting changes ([:AuCommit](, commit messages are remembered in case of 
-    rollback ([g:aurum_remembermsg](
+    rollback ([g:aurum_remembermsg](
   - 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](, 
+Most commands can be reached with a set of mappings (see [aurum-mappings](, 
 all mappings are customizable.
     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.
     " 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])
 :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