I'd like some login management support from within
p4.el. I'm no elisp expert, but I've created the
following functions which have worked for me. Note that
what I've done doesn't look to see whether $P4PASSWD
has been set, thus preferring to use that password, and
there is no custom integration for specifying the
password file. Also, using shell-command isn't as good
as some of the other means available for invoking a
process, but it worked for me.
;; Logs into p4
(defun p4-login-simple ()
(shell-command "p4 login < $HOME/.p4passwd > /dev/null")
)
;; Logs out of p4
;;
;; Logging in before logging out prevents error
messages and ensures any
;; outstanding tickets are cleared.
(defun p4-logout ()
(interactive)
(p4-login-simple)
(shell-command "p4 logout > /dev/null")
)
;; Logs into p4 using the password stored in
$HOME/.p4passwd (which should have
;; mode 0600.
;;
;; Logging out before logging in ensures you get the
full timeout available
;; rather than just an extension (which is always less
than the full timeout).
(defun p4-login ()
(interactive)
(p4-logout)
(p4-login-simple)
)
;; Reports on any available p4 login tickets
(defun p4-tickets ()
(interactive)
(shell-command "p4 tickets")
)
Robert Stewart
None
Next Release (example)
Public
|
Date: 2008-06-13 02:20
|
|
Date: 2008-05-14 02:20
|
|
Date: 2008-04-29 19:59 Logged In: NO |
|
Date: 2007-10-08 13:12
|
|
Date: 2007-10-06 02:20
|
|
Date: 2007-08-25 03:51
|
| Field | Old Value | Date | By |
|---|---|---|---|
| close_date | 2008-05-29 17:55 | 2008-06-13 02:20 | sf-robot |
| status_id | Pending | 2008-06-13 02:20 | sf-robot |
| close_date | 2008-05-14 02:20 | 2008-05-29 17:55 | rstewart |
| status_id | Closed | 2008-05-29 17:55 | rstewart |
| status_id | Pending | 2008-05-14 02:20 | sf-robot |
| close_date | 2008-04-29 20:10 | 2008-05-14 02:20 | sf-robot |
| status_id | Open | 2008-04-29 20:10 | rstewart |
| close_date | - | 2008-04-29 20:10 | rstewart |
| status_id | Closed | 2007-10-08 13:12 | rstewart |
| close_date | 2007-10-06 02:20 | 2007-10-08 13:12 | rstewart |
| status_id | Pending | 2007-10-06 02:20 | sf-robot |
| close_date | 2007-09-21 18:51 | 2007-10-06 02:20 | sf-robot |
| status_id | Open | 2007-09-21 18:51 | rstewart |
| close_date | - | 2007-09-21 18:51 | rstewart |
| assigned_to | nobody | 2007-09-21 18:51 | rstewart |
| artifact_group_id | None | 2007-09-21 18:51 | rstewart |