Vim Tips Wiki
Advertisement

Use this page to discuss script 167 perforce: Perforce source control features

  • Add constructive comments, bug reports, or discuss improvements (see the guideline).
  • Do not document the script here (the author should do that on vim.org).
  • This page may be out of date: check the script's vim.org page above, and its release notes.

Unix users

Edit line 106 to change p4.exe to p4

"Basic check for p4-enablement
if executable( "p4" )
   let s:PerforceExecutable="p4"
else

And do a dos2unix to convert line endings:

$vim perforce.vim
:set ff=unix
:wq!

Handling AltRoots

If you have altroots in your perforce user specification you might want to add the equivalent of 'alias p4='p4 -d `/bin/pwd`'

I did this by changing this around line 105:

"Basic check for p4-enablement
if executable( "p4" )
    let s:PerforceExecutable="p4 -d " . getcwd()
else
    augroup! perforce
endif 

Not Requiring a Changelist

This plugin assumes you use the methodology where you have an explicit changelist created for every edit. If you want to use a default changelist, then you need to remove the "-c" options given to a couple commands:

Line 335-ish

"     let listnum = ""
"     let listnum = s:P4GetChangelist( "Current changelists:\n" . s:P4GetChangelists(0) . "\nEnter changelist number: ",
"     if listnum == ""
"         echomsg "No changelist specified. Edit cancelled."
"         return
"     endif
"     call s:P4ShellCommandCurrentBuffer( action . " -c " . listnum )
    call s:P4ShellCommandCurrentBuffer( action )

Line 366-ish

"         let listnum = ""
"         let listnum = s:P4GetChangelist( "Current changelists:\n" . s:P4GetChangelists(0) . "\nEnter changelist number
"         if listnum == ""
"             echomsg "No changelist specified. Delete cancelled."
"             return
"         endif
"         call s:P4ShellCommandCurrentBuffer( "delete -c " . listnum )
        call s:P4ShellCommandCurrentBuffer( "delete" )

Comments

Advertisement