Fix whitespace

This commit is contained in:
Tom Willemse 2017-06-07 00:03:49 -07:00
parent 3cb296d970
commit e7a25a4fda
2 changed files with 455 additions and 467 deletions

View file

@ -69,9 +69,7 @@ a portion of the error string you wish to ignore."
avoid an error on systems on which the Perforce client is not installed."
(if (and (boundp 'exec-suffixes) (fboundp 'file-executable-p))
(locate-file p4-lowlevel-p4-program exec-path exec-suffixes 'file-executable-p) ; GNU Emacs
(locate-file p4-lowlevel-p4-program exec-path '("" ".btm" ".bat" ".cmd" ".exe" ".com") 'executable) ; XEmacs
)
)
(locate-file p4-lowlevel-p4-program exec-path '("" ".btm" ".bat" ".cmd" ".exe" ".com") 'executable))) ; XEmacs
(defun p4-lowlevel-command-to-buffer (args &optional input output)
"Call `p4-lowlevel-p4-command' with specified list of ARGS.
@ -213,15 +211,8 @@ the return value of `p4-lowlevel-command-to-buffer' on failure."
(progn
(setq should-ignore t)
(if p4-lowlevel-command-messages
(message "Ignoring error: %s" error-string)
)
)
)
)
)
nil
)
)
(message "Ignoring error: %s" error-string))))))
nil))
(defun p4-lowlevel-successful-alist-p (output)
"Determines if OUTPUT, a buffer or alist, is from a successful p4 command.
@ -367,12 +358,12 @@ commands."
(concat "@" rev)
rev))))))
; Here's what we need to support from the "p4 add" command, at least
; for the time being:
;
; Do NOT need to support "-c".
; Do NOT need to support "-t".
; Do NOT need to support the specification of multiple files.
; Here's what we need to support from the "p4 add" command, at least
; for the time being:
;
; Do NOT need to support "-c".
; Do NOT need to support "-t".
; Do NOT need to support the specification of multiple files.
(defun p4-lowlevel-add (file)
"Tell Perforce to add FILE to the repository.
@ -382,14 +373,14 @@ Returns nil or raises an error on failure."
; an attempt to add a file which already exists in the repository.
(p4-lowlevel-command-or-error (list "add" file)))
; Here's what we need to support from the "p4 change" command, at
; least for the time being:
;
; Do NOT need to support "-f".
; Do NOT need to support "-d".
; DO need to support "-o".
; DO need to support "-i".
; DO need to support specified changelist #'s.
; Here's what we need to support from the "p4 change" command, at
; least for the time being:
;
; Do NOT need to support "-f".
; Do NOT need to support "-d".
; DO need to support "-o".
; DO need to support "-i".
; DO need to support specified changelist #'s.
(defun p4-lowlevel-change (&optional buffer op)
"Creates or edits a P4 changelist from/to BUFFER.
@ -444,15 +435,15 @@ value with `-m'; if S-VAL is non-nil, pass that value with `-s'."
(list full-file))
nil output-format)))
; Here's what we need to support from the "p4 diff" command, at
; least for the time being:
;
; DO need to support "-d<flag>".
; DO need to support "-f" (in fact, need to specify it all the time).
; Do NOT need to support "-s<flag>".
; DO need to support "-t" (in fact, need to specify it all the time).
; DO need to support diffing a single file.
; Do NOT need to support diffing multiple files.
; Here's what we need to support from the "p4 diff" command, at
; least for the time being:
;
; DO need to support "-d<flag>".
; DO need to support "-f" (in fact, need to specify it all the time).
; Do NOT need to support "-s<flag>".
; DO need to support "-t" (in fact, need to specify it all the time).
; DO need to support diffing a single file.
; Do NOT need to support diffing multiple files.
(defun p4-lowlevel-diff (files &optional rev buffer)
"Run `p4 diff' on FILE at revision REV and return a buffer
@ -490,13 +481,13 @@ return a list of the matching files."
(format "-s%s" flag)
file))))
; Here's what we need to support from the "p4 diff2" command, at least
; for the time being:
;
; DO need to support "-d<flag>".
; Do NOT need to support "-q".
; DO need to support "-t" (in fact, need to specify it all the time).
; Do NOT need to support "-b".
; Here's what we need to support from the "p4 diff2" command, at least
; for the time being:
;
; DO need to support "-d<flag>".
; Do NOT need to support "-q".
; DO need to support "-t" (in fact, need to specify it all the time).
; Do NOT need to support "-b".
(defun p4-lowlevel-diff2 (file1 file2 &optional rev1 rev2 buffer)
"Run `p4 diff2' on FILE and FILE2 and return a buffer containing the
@ -514,25 +505,25 @@ optional BUFFER is non-nil, output goes in that buffer. Uses
(or buffer "diff"))))
buffer))
; Here's what we need to support from the "p4 edit" command, at least
; for the time being:
;
; Do NOT need to support "-c".
; Do NOT need to support "-t".
; Do NOT need to support the specification of multiple files.
; Here's what we need to support from the "p4 edit" command, at least
; for the time being:
;
; Do NOT need to support "-c".
; Do NOT need to support "-t".
; Do NOT need to support the specification of multiple files.
(defun p4-lowlevel-edit (file)
"Tell Perforce we want to edit FILE.
Returns non-nil on success or nil on failure (or raises an error)."
(p4-lowlevel-command-or-error (list "edit" file)))
; Here's what we need to support from the "p4 filelog" command, at
; least for the time being:
;
; DO need to support "-i".
; DO need to support "-l".
; Do NOT need to support "-m".
; Do NOT need to support the specification of multiple files.
; Here's what we need to support from the "p4 filelog" command, at
; least for the time being:
;
; DO need to support "-i".
; DO need to support "-l".
; Do NOT need to support "-m".
; Do NOT need to support the specification of multiple files.
(defun p4-lowlevel-filelog (file &optional buffer long follow-branches limit)
"Fetch the p4 log of FILE and return a buffer containing it.
@ -551,11 +542,11 @@ last LIMIT log entries."
"Fetch the string returned by running `p4 opened' on FILE."
(p4-lowlevel-command-or-error (list "opened" file) nil 'string))
; Here's what we need to support from the "p4 fstat" command, at least
; for the time being:
;
; Do NOT need to support any command-line switches.
; Do NOT need to support the specification of multiple files.
; Here's what we need to support from the "p4 fstat" command, at least
; for the time being:
;
; Do NOT need to support any command-line switches.
; Do NOT need to support the specification of multiple files.
(defun p4-lowlevel-fstat (file &optional rev noerror)
"Fetch p4 information about FILE (optionally, at REV).
@ -618,13 +609,13 @@ QUIET is non-nil, then the `-q' flag is passed to `p4 print'."
(args (append (list "print") quiet-args (list fullfile))))
(p4-lowlevel-command-or-error args nil output-format)))
; Here's what we need to support from the "p4 reopen" command, at
; least for the time being:
;
; DO need to support "-c changelist#", so that we can reopen a file in
; the default changelist before submitting it.
; Do NOT need to support "-t".
; Do NOT need to support the specification of multiple files.
; Here's what we need to support from the "p4 reopen" command, at
; least for the time being:
;
; DO need to support "-c changelist#", so that we can reopen a file in
; the default changelist before submitting it.
; Do NOT need to support "-t".
; Do NOT need to support the specification of multiple files.
(defun p4-lowlevel-reopen (file &optional changelist)
"Call `p4 reopen' on FILE.
@ -633,16 +624,16 @@ Optional CHANGELIST specifies the changelist to which to move it."
(if changelist (list "-c" changelist) nil)
(list file))))
; Here's what we need to support from the "p4 resolve" command, at
; least for the time being:
;
; DO need to support "-af" (in fact, need to specify it all the time).
; Do NOT need to support "-am", "-as", "-at", "-ay".
; Do NOT need to support "-f".
; Do NOT need to support "-n".
; DO need to support "-t" (in fact, need to specify it all the time).
; Do NOT need to support "-v".
; Do NOT need to support the specification of multiple files.
; Here's what we need to support from the "p4 resolve" command, at
; least for the time being:
;
; DO need to support "-af" (in fact, need to specify it all the time).
; Do NOT need to support "-am", "-as", "-at", "-ay".
; Do NOT need to support "-f".
; Do NOT need to support "-n".
; DO need to support "-t" (in fact, need to specify it all the time).
; Do NOT need to support "-v".
; Do NOT need to support the specification of multiple files.
(defun p4-lowlevel-resolve (file)
"Call `p4 resolve' on FILE.
@ -650,22 +641,22 @@ Specifies the `-af' and `-t' options to ensure a non-interactive
resolve. Raises an error if the command fails."
(p4-lowlevel-command-or-error (list "resolve" "-af" "-t" file)))
; Here's what we need to support from the "p4 revert" command, at
; least for the time being:
;
; Do NOT need to support "-a".
; Do NOT need to support "-c".
; Do NOT need to support the specification of multiple files.
; Here's what we need to support from the "p4 revert" command, at
; least for the time being:
;
; Do NOT need to support "-a".
; Do NOT need to support "-c".
; Do NOT need to support the specification of multiple files.
(defun p4-lowlevel-revert (file)
"Tell Perforce to unedit FILE."
(p4-lowlevel-command-or-error (list "revert" file)))
; Here's what we need to support from the "p4 submit" command, at
; least for the time being:
;
; Only need to support non-interactive use; therefore, only need to
; support "p4 submit -i".
; Here's what we need to support from the "p4 submit" command, at
; least for the time being:
;
; Only need to support non-interactive use; therefore, only need to
; support "p4 submit -i".
(defun p4-lowlevel-submit (change-spec)
"Calls `p4 submit' on CHANGE-SPEC, which should be a string or buffer."
@ -680,13 +671,13 @@ resolve. Raises an error if the command fails."
(insert change-spec)))
(p4-lowlevel-command-or-error (list "submit" "-i") buffer)))
; Here's what we need to support from the "p4 sync" command, at least
; for the time being:
;
; DO need to support "-f".
; Do NOT need to support "-n".
; DO need to support the specification of a file revision.
; Do NOT need to support the specification of multiple files.
; Here's what we need to support from the "p4 sync" command, at least
; for the time being:
;
; DO need to support "-f".
; Do NOT need to support "-n".
; DO need to support the specification of a file revision.
; Do NOT need to support the specification of multiple files.
(defun p4-lowlevel-sync (file &optional rev force)
"Call `p4 sync' for FILE.

View file

@ -72,8 +72,8 @@
(if (not (memq 'P4 vc-handled-backends))
(setq vc-handled-backends (cons 'P4 vc-handled-backends)))
; This is useful during development to ensure that we can simply
; reeval this buffer to get any new functions that have been added.
; This is useful during development to ensure that we can simply
; reeval this buffer to get any new functions that have been added.
(put 'P4 'vc-functions nil)
(defcustom vc-p4-require-p4config nil
@ -99,7 +99,6 @@ specify a starting date when you run C-u C-x v g."
:type 'string
:group 'vc)
(defun vc-p4-create-repo ()
(error "create-repo not supported yet for P4"))
@ -158,8 +157,7 @@ compare non-open files to the depot version."
(and (null haveRev) (string= headAction "delete")))
'up-to-date)
(t
'needs-patch)))
)
'needs-patch))))
(vc-file-setprop file 'vc-p4-did-fstat t)
(vc-file-setprop file 'vc-p4-depot-file depotFile)
(vc-file-setprop file 'vc-p4-action action)
@ -686,8 +684,7 @@ Optional arg VERSION is a version to annotate from."
(save-excursion
;; (set-buffer buffer)
(if (> (count-lines (point-min) (point-max)) 1)
(error "File pattern maps to more than one file.")))
)
(error "File pattern maps to more than one file."))))
;; get the file change history:
;;(p4-exec-p4 buffer (list "filelog" "-i" file-spec) t)
(with-temp-buffer
@ -732,12 +729,12 @@ Optional arg VERSION is a version to annotate from."
(cons
(cons ch (list rev date author cur-file)) ch-alist))
(if (not head-rev) (setq head-rev rev))
(setq headseen t)) ))
(setq headseen t))))
;; not if we have entered a branch (this used to be used, isn't
;; right now - maybe again later:
(if (and headseen (looking-at blame-branch-regex))
(setq branch-p t)) )
(setq branch-p t)))
(forward-line))))
(if (< (length ch-alist) 1)