Share

Perforce-Emacs Integration Library

Tracker: Feature Requests

5 Need login management - ID: 1213736
Last Update: Comment added ( sf-robot )

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 ( rstewart ) - 2005-06-02 19:25

5

Closed

None

Robert Stewart

None

Next Release (example)

Public


Comments ( 6 )




Date: 2008-06-13 02:20
Sender: sf-robotSourceForge.net Site Admin


This Tracker item was closed automatically by the system. It was
previously set to a Pending status, and the original submitter
did not respond within 14 days (the time period specified by
the administrator of this Tracker).


Date: 2008-05-14 02:20
Sender: sf-robotSourceForge.net Site Admin


This Tracker item was closed automatically by the system. It was
previously set to a Pending status, and the original submitter
did not respond within 14 days (the time period specified by
the administrator of this Tracker).


Date: 2008-04-29 19:59
Sender: nobody

Logged In: NO

Here is a function I put in my ~/.emacs file that prompts for a password
and then attempts to login.

(defun p4-login ()
(interactive)
(if (zerop (shell-command (concat
"echo "
(read-passwd "Password: ")
"|p4 login > /dev/null")))
(message "Logged in")
(message "Unable to log in")))




Date: 2007-10-08 13:12
Sender: rstewartProject Admin


This feature will be part of the next release.


Date: 2007-10-06 02:20
Sender: sf-robotSourceForge.net Site Admin


This Tracker item was closed automatically by the system. It was
previously set to a Pending status, and the original submitter
did not respond within 14 days (the time period specified by
the administrator of this Tracker).


Date: 2007-08-25 03:51
Sender: rstewartProject Admin


I have even better support for login management in my local p4.el.


Log in to comment.




Attached File

No Files Currently Attached

Changes ( 16 )

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