Commit graph

86 commits

Author SHA1 Message Date
4ecf8cd2bc Fix ‘rename-file’ method name 2022-03-02 16:39:11 -08:00
3d066413de Replace ‘goto-line’ with ‘forward-line’
According to the documentation of ‘goto-line’, it's usually not what you want
for a lisp program. It's not entirely clear why, but I suspect it has something
to do with either hooks run, or some effect it'll have on state.

This commit replaces it with the suggested

    (goto-char (point-min))
    (forward-line (-1 N))

Where N is the argument previously given to ‘goto-line’.
2022-01-23 20:58:25 -08:00
bab0d7083d
Set the current directory in ‘vc-p4-dir-extra-headers’
It seems like it might be possible that this function gets called in the wrong
directory, so just to be sure set the current directory to the one passed in.
This _should_ make sure that ‘p4’ is called in the right directory.
2021-09-16 23:02:04 -07:00
2180dc8535
Replace ‘vc-workfile-version’ with ‘vc-working-revision’
As far as I can tell there is no ‘vc-workfile-version’ function anywhere. There
is a property with that name set on files by vc-p4, but it seems that the
function we’re looking for is actually ‘vc-working-revision’.
2021-09-08 00:22:54 -07:00
905e88a1bd
Remove ‘vc-p4-client’
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.
2021-09-08 00:12:03 -07:00
0f054faa4d Use the right client for ‘vc-dir’ 2021-03-10 18:10:16 -08:00
461b1357f9 Rename ‘vc-p4-find-version’ to ‘vc-p4-find-revision’
It seems that nothing uses ‘vc-p4-find-version’, or ‘vc-find-version’, and it’s
not mentioned as a function to implement in vc.el. There is a ‘find-revision’
mentioned with the same signature though.
2021-02-27 15:25:22 -08:00
a4c79a8ea3 Fix some warnings 2021-02-27 15:12:12 -08:00
dcb212c410 Fix as many as possible checkdoc issues 2021-02-27 14:09:44 -08:00
48237437e8 Add ‘vc-p4-rename’
In Perforce renaming and deleting and creating files are different things. In
the latter situation any history is lost.
2021-02-24 22:17:00 -08:00
f3423ce275 Add ‘vc-p4-dir-extra-headers’
This function shows extra information in the header of VC dir buffers.
2021-01-28 18:54:27 -08:00
ccccdbe03e Fix the status where a file has changes
VC Expects the backend to report that the status is ‘needs-update’, not
‘needs-patch’. I don’t know if this has changed over the years, but this is what
it needs now.
2021-01-28 16:18:02 -08:00
39efc77e07 Fix ‘vc-p4-checkin’
- The arguments ‘comment’ and ‘rev’ have been switched. I don’t know if this
  used to be different from how it is now, but ‘rev’ comes last now and is
  optional.

- The ‘vc-p4-client’ needs to be collected from the first file in the list of
  files to check in because ‘vc-p4-checkin’ is called from a different buffer
  that isn’t in the same directory.

- ‘vc-p4-client’ also needs to be stored under a different name so that when it
  changes to the ‘*p4-lowlevel-changes*’ buffer it doesn’t clear the value.

- Instead of inserting the specified comment directly, send it through
  ‘log-edit-extract-headers’ which removes the "Summary: " header that
  ‘vc-log-edit’ adds.

- Indent rigidly to ‘tab-width’ instead of 8. Indenting to 8 added too many tabs
  to the description and caused all lines to be prefixed by a tab.
2021-01-25 17:06:41 -08:00
7af739cc7d Add client argument to ‘vc-p4-delete’ 2021-01-23 10:34:05 -08:00
a9bf4c10ad Add client arg to ‘vc-p4-update-changelog’ 2021-01-23 10:30:34 -08:00
7726d77a94 Add client argument to ‘vc-p4-print-log’ 2021-01-23 10:25:34 -08:00
ed30884133 Add client argument to ‘vc-p4-steal-lock’ 2021-01-23 10:19:13 -08:00
a24331f2cc Fix ‘p4-lowlevel-sync’ call 2021-01-23 10:04:00 -08:00
8c75982f01 Add client argument for merging files 2021-01-23 10:01:21 -08:00
5c39509421 Add client argument for checking in files 2021-01-23 09:50:29 -08:00
553914a5ac Fix using client for registering new files 2021-01-23 09:39:24 -08:00
b95132e71e Add client arguments for ‘p4 add’ 2021-01-23 09:34:20 -08:00
5bc33dcc44 Fix usage of ‘alist-get’
By default ‘alist-get’ uses ‘eq’ to compare keys, which doesn’t work for strings
reliably (I’m actually surprised it works at all).
2021-01-23 09:30:46 -08:00
a535c47e93 Make ‘vc-revert’ work with the current client 2021-01-22 21:58:40 -08:00
a60278efa7 Make checking out files with a client work 2021-01-22 21:35:20 -08:00
2b270a93f0 Add client argument to ‘p4-lowlevel-revert’ 2021-01-21 23:13:18 -08:00
6724d2b827 Specify client for initial responsibility check 2021-01-21 19:15:08 -08:00
4c5fc58d6d Enable lexical binding for project files 2021-01-14 23:12:30 -08:00
23bacc0d4b Add login commands
- 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.
2021-01-14 22:39:21 -08:00
a1141460b8 Update ‘vc-p4-dir-status’ to ‘vc-p4-dir-status-files’
Newer versions of VC have changed the way ‘vc-dir’ calls each back-end.
2020-05-27 18:18:41 -07:00
d32dd5f376 Simplify and fix ‘vc-p4-is-in-client’
Quoting the string with Windows paths in it would double-quote the directory
separators. It also seems easier to use ‘string-prefix-p’ than an anchored
regular expression.

‘alist-get’ is a function that was introduced in Emacs 25 that is easier to use
than ‘assoc’ + ‘cdr’.
2020-05-27 17:57:45 -07:00
35beacc3d6 Fix indentation of comments, reflow 2020-05-13 11:29:35 -07:00
749665a8ae Add support for the vc-delete command 2020-05-13 11:07:38 -07:00
774ab55e9e Add simplistic vc-p4-switch-client command 2020-03-02 21:08:23 -08:00
d53eb68743 Fix indentation 2017-06-07 12:34:06 -07:00
94077d5136 Update vc-p4-diff argument list
Newer versions of vc add in an async flag, this is not currently used
by us.
2017-06-07 12:08:30 -07:00
5596f66072 Fix vc-p4-diff for buffer string argument
BUFF may be a string as well as a buffer. In case it is a string it
should use that string to create the buffer for the diff.
2017-06-07 00:12:36 -07:00
600e9e2f71 Update vc-p4-checkout for modern vc
The argument list for the ‘vc-*-checkout’ function doesn’t include
destfile or editable anymore.
2017-06-07 00:09:07 -07:00
47eb5350df Add required vc function
‘vc-p4-revision-granularity’ is a required function that should be
implemented by all vc backends. Perforce has per-file revisions.
2017-06-07 00:05:59 -07:00
e7a25a4fda Fix whitespace 2017-06-07 00:03:49 -07:00
Ben_Key
3cb296d970 Various modifications to vc-p4 that I have been using for years.
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]
2015-03-10 14:43:47 -08:00
Magnus Henoch
015a4a67dc * vc-p4.el (vc-p4-state): Mark new files as added.
[git-p4: depot-paths = "//guest/Ben_Key/vc-p4/,//guest/jonathan_kamens/vc-p4/,//guest/magnus_henoch/vc-p4/": change = 7742]
2010-08-09 09:58:53 -08:00
Magnus Henoch
508d650136 * vc-p4.el (vc-p4-state): Don't compare non-existent files.
[git-p4: depot-paths = "//guest/Ben_Key/vc-p4/,//guest/jonathan_kamens/vc-p4/,//guest/magnus_henoch/vc-p4/": change = 7741]
2010-08-09 08:46:04 -08:00
Magnus Henoch
0cfe10cab9 * vc-p4.el (vc-p4-workfile-unchanged-p): Return nil for files marked for deletion.
[git-p4: depot-paths = "//guest/Ben_Key/vc-p4/,//guest/jonathan_kamens/vc-p4/,//guest/magnus_henoch/vc-p4/": change = 7740]
2010-08-09 08:35:34 -08:00
Magnus Henoch
1674c9ea2a * vc-p4.el (vc-p4-diff): Handle deleted files.
[git-p4: depot-paths = "//guest/Ben_Key/vc-p4/,//guest/jonathan_kamens/vc-p4/,//guest/magnus_henoch/vc-p4/": change = 7739]
2010-08-09 08:28:09 -08:00
Magnus Henoch
a8fbf9a3b1 * vc-p4.el (vc-p4-state): Mark file as `removed' if action is "delete".
[git-p4: depot-paths = "//guest/Ben_Key/vc-p4/,//guest/jonathan_kamens/vc-p4/,//guest/magnus_henoch/vc-p4/": change = 7738]
2010-08-09 07:53:27 -08:00
Magnus Henoch
6c3758972c * vc-p4.el (vc-p4-previous-revision): New function, shamelessly
copied from vc-svn.

[git-p4: depot-paths = "//guest/Ben_Key/vc-p4/,//guest/jonathan_kamens/vc-p4/,//guest/magnus_henoch/vc-p4/": change = 7546]
2010-01-13 09:01:58 -08:00
Magnus Henoch
a546229293 * vc-p4.el (vc-p4-print-log): Accept optional argument revision,
as required by Emacs 23.1.91.

[git-p4: depot-paths = "//guest/Ben_Key/vc-p4/,//guest/jonathan_kamens/vc-p4/,//guest/magnus_henoch/vc-p4/": change = 7545]
2010-01-13 08:57:06 -08:00
Magnus Henoch
a0e7fbe5e1 * vc-p4.el (vc-p4-print-log): Accept optional arguments shortlog
and limit, as required by Emacs 23.1.50.

* p4-lowlevel.el (p4-lowlevel-filelog): Accept limit argument.

[git-p4: depot-paths = "//guest/Ben_Key/vc-p4/,//guest/jonathan_kamens/vc-p4/,//guest/magnus_henoch/vc-p4/": change = 7487]
2009-11-17 16:35:08 -08:00
Magnus Henoch
af857b4d50 * vc-p4.el (vc-p4-revert): Fix revert of unopened files.
[git-p4: depot-paths = "//guest/Ben_Key/vc-p4/,//guest/jonathan_kamens/vc-p4/,//guest/magnus_henoch/vc-p4/": change = 7486]
2009-11-17 08:06:39 -08:00