ZyX_I  committed 9de8556

Consistency change: use bang instead of “force” option

  • Participants
  • Parent commits cb4c8cc
  • Tags release-1.2.2

Comments (0)

Files changed (3)

File doc/aurum.txt

     Annotate rev {rev} of a file {file}. By default annotates current revision 
     of a current file (|aurum-current-file|).
-AuBranch {branch} [repo {repo}] [force]                            *:AuBranch*
+AuBranch[!] {branch} [repo {repo}]                                 *:AuBranch*
     Set current branch name to {branch}.
 AuCommit {options} [glob1 [glob2 [...]]]                           *:AuCommit*

File plugin/aurum.vim

     " TODO :AuMerge ?
     " TODO :AuExplore
     let s:addargs={'Update': {'bang': 1}, 'Move': {'bang': 1},
-                \    'Name': {'bang': 1}}
+                \  'Branch': {'bang': 1}, 'Name': {'bang': 1}}
     for s:cmd in ['Update', 'Move', 'Junk', 'Track', 'Hyperlink', 'Grep',
                 \ 'Branch', 'Name']
         let s:part=tolower(s:cmd[:3])
             \'\Vfiles \+type ""', 'files (path)', ''),
             \'\v(rev%(ision|range))\ +\Vtype ""', '\1 '.s:_r.comp.rev, 'g'))
 "▶1 branfunc
-function s:branfunc.function(branch, opts)
+function s:branfunc.function(bang, branch, opts)
     let repo=s:_r.repo.get(a:opts.repo)
     call s:_r.cmdutils.checkrepo(repo)
-    let force=get(a:opts, 'force', 0)
+    let force=a:bang
     if !force && index(repo.functions.getrepoprop(repo, 'brancheslist'),
                 \      a:branch)!=-1
         call s:_f.throw('bexsts', a:branch, repo.path)
     call repo.functions.branch(repo, a:branch, force)
-let s:branfunc['@FWC']=['-onlystrings '.
+let s:branfunc['@FWC']=['-onlystrings _ '.
             \           'type "" '.
             \           '{  repo '.s:_r.cmdutils.nogetrepoarg.
-            \           ' ?!force'.
             \           '}', 'filter']
 call add(s:brancomp, s:branfunc['@FWC'][0])
 "▶1 namefunc

File test/

 :R silent AuCommit type ? message Added\ deffile deffile
 :W{{{1 force C
-:R silent AuBranch C force
+:R silent AuBranch! C
 :R call writefile(['ghi'], 'ghifile')
 :R silent AuCommit type ? message Added\ ghifile ghifile