Calling ‘p4-lowlevel-command-or-error’ on a buffer will output the raw response
from Perforce, which includes tags like ‘text:’ and ‘exit:’ at the start of each
line. These tags are used by the low-level functions to find the right data and
figure out if the given command succeeded or not.
Using ‘p4-lowlevel-command-into-buffer’ should have the desired behaviour of
cutting out all the tags and showing only the actual contents of the response.
This will make sure that the “other” buffer doesn't display all lines have
changed because suddenly each line starts with a tag.
If ‘p4-vc-rename-file’ is used and the file that's been renamed is open in a
buffer, change that buffer's visited file name so that when you switch to it and
start editing it, it doesn't save to the original file and your modifications
will have to be moved over.
When I wrote this feature I didn’t realize that this functionality is already
built into Perforce itself. By using the ‘P4CONFIG’ variable you can specify the
name of a file that ‘p4’ will look for that can specify the client (among
others) for that directory and all subdirectories.
- Add command ‘vc-p4-logged-in-p’ to check if the user is currently logged in.
- Add command ‘vc-p4-login’ to log in if the user isn’t already logged in.
- Add better error reporting for the situation where a user isn’t logged in.
Unfortunately I did not document the changes as I made them. I have been able to determine the purpose of most of the changes by code inspection but there are a few changes for which I have not been able to determine a purpose.
* Modifications to support XEmacs.
* Added the p4-lowlevel-locate-p4 function. This function is used to locate the p4 executable on the exec-path. It is used by the vc-p4-registered function to avoid an error on systems on which the Perforce client is not installed. This is useful if the same .emacs file is used on multiple systems, some of which do not have the Perforce client installed.
* Modified the p4-lowlevel-successful-alist-p function so that a command that returns the message "file(s) up-to-date" does not trigger an error. As part of this change I added the p4-lowlevel-ignore-error-list defcustom and the p4-lowlevel-should-ignore-error function.
* Modified the vc-p4-registered function so that it uses the p4-lowlevel-locate-p4 function to verify that the Perforce client is installed.
[git-p4: depot-paths = "//guest/Ben_Key/vc-p4/,//guest/jonathan_kamens/vc-p4/,//guest/magnus_henoch/vc-p4/": change = 12013]
single request to the server in the simplest case (diff edited
file to synced version).
* p4-lowlevel.el (p4-lowlevel-command-into-buffer): Don't reorder
info and text lines.
(p4-lowlevel-diff): Support lists of files as well as a single file.
[git-p4: depot-paths = "//guest/Ben_Key/vc-p4/,//guest/jonathan_kamens/vc-p4/,//guest/magnus_henoch/vc-p4/": change = 7484]
For vc-p4.el:
- delete a few more vc functions that are identical in emacs
- delete now unused vc-p4-change-times
- make vc-p4-annotate-command default to the internal elisp code
- delete vc-p4-state-heuristic, it's the same as the default
- new function vc-p4-find-version
- make a few functions cope with emacs-23 (not released yet),
that changes the first argument from FILE to FILE_LIST
- add an internal implementation for vc-annotate, simplify the
annotate code
For p4-lowlevel.el:
- fail graciously when offline and trying to access a file that
is under perforce
[git-p4: depot-paths = "//guest/Ben_Key/vc-p4/,//guest/jonathan_kamens/vc-p4/,//guest/magnus_henoch/vc-p4/": change = 5999]