starteam-el-users Mailing List for starteam.el
Status: Beta
Brought to you by:
m0smith
You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(2) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Matthew S. <m0...@sd...> - 2003-02-18 20:49:50
|
>From the documentation: Documentation: Regular expression to match up to the file name in a directory listing. The default value is designed to recognize dates and times regardless of the language. Defined in `dired'. So, it is a regular expression that defines where the filename exists in a line. In this case, the line is a line as returned from StarTeam. The way it works is to search for a line matching the regular expression and to put the cursor at the end of the matching expression. That is, the filename is assumed to be at the end of the regular expression. I have not used xEmacs so I can't be too helpful. On Tue, 2003-02-18 at 08:26, Jim Crossley wrote: > The following message is a courtesy copy of an article > that has been posted to comp.emacs.xemacs as well. > > The starteam package attemts to derive a mode from dired-mode. It > relies on the dired-move-to-filename-regexp variable to make this > work. Unfortunately, the Xemacs version of dired-mode doesn't use > this variable, so the starteam package only works on fsf emacs. > > The Xemacs version uses extents, which I don't really understand. > Below is the value starteam uses for the regexp. Can you give me a > clue about how to duplicate the behavior implied by this regexp in > Xemacs? > > (set (make-local-variable 'dired-move-to-filename-regexp) > "\\(\\(.ot in View\\|.ut of Date\\|.urrent\\|.odified\\|.issing\\|.p to Date\\|.erge\\|.nknown\\)[A-Za-z\t]*r*[w\-]* *[0-9]+/[0-9]+/[0-9]+ [0-9]+:[0-9]+:[0-9]+[A-Z]+[0-9]+ \\)\\|\\(Folder:.*(working dir: \\)") > > Thanks |
|
From: Inger, M. <in...@Sy...> - 2002-12-13 16:01:55
|
I've made a few fixes to the starteam.el library to account for the
configuration
of starteam that i have here. They may be useful for everyone though, so
please
evaluate and whoever maintains the code, if you think they're useful, please
put them
in.. The 2 problems are as follows:
1) The directory "src" at the root level of the project view has a working
folder
of "WEB-INF/src", so if i check out "src/file.java" it ends up at
"WEB-INF/src/file.java".
When alist is: ((E:/Project Project/View))
I try to list "Project/View/WEB-INF/src", and the module
interperates this
as me wanting to list "WEB-INF/src", which of course doesn't exist
When alist is: ((E:/Project/WEB-INF Project/View))
I can successfully list "Project/View/WEB-INF/src", however, it now
has decided
(due to the params "-rp E:/Project/WEB-INF") that the directory will
be stored at
"E:/Project/WEB-INF/WEB-INF/src" it simply appends the working
folder for the
"src" folder to the working folder for the project. Hence, the
double WEB-INF.
The following changes will files that problem:
a) The structure of the list is a little different. (If anyone knows
how to get this into
a real alist, let me know, my Lisp Skills are a bit rusty)
((E:/Project/WEB-INF/src E:/Project Project/View)
(E:/Project E:/Project Project/View))
The second item in the list is what should be used as the working
folder for
the project, when the file matches the pattern in the first item
in the list.
b) The following function changes are necessary to accout for this
(I've removed
the comments for ease of reading
(defun starteam-get-starteam-path-from-local-path (local-dir)
(let ((still-looking t)
(path nil))
(mapcar (function (lambda (x)
(if (and still-looking
(string-match (nth 0 x) local-dir))
(setq still-looking nil
path (concat (nth 2 x)
(substring local-dir
(match-end 0))))
nil)))
starteam-to-directory-alist)
(if (not path)
(error "Could match local path %s to path in any known Starteam
view" local-dir)
path)
))
(defun starteam-get-working-dir-from-local-path (local-dir)
(let* ((working-dir nil)
(still-looking t))
(mapcar (lambda (x)
(if (and still-looking
(string-match (nth 0 x) local-dir))
(setq still-looking nil
working-dir (nth 1 x))
nil))
starteam-to-directory-alist)
(if (not working-dir)
(error "Could match local path %s to path in any known Starteam
view" local-dir)
working-dir)
))
2) There was no way to recursively create the directory structure unless you
checked out
all the files. So, I build the following method to do this:
(defun starteam-build-directory-structure (indir)
(interactive "DDirectory Name:")
(let*
((dir (expand-file-name indir))
(path (starteam-get-starteam-path-from-local-path dir))
(output-buffer)
(command "local-mkdir")
)
(message "Building recursive directory structure for %s..." dir)
(save-excursion
(setq output-buffer
(starteam-execute command
"LOCAL MKDIR"
path ""
"-is" "-rp"
(starteam-get-working-dir-from-local-path dir)))
)
(switch-to-buffer output-buffer)
)
)
Which requires the following method to be changed to allow for any empty
file
specification:
(defun starteam-execute (command operation-string path &optional file &rest
args)
(if starteam-debug
(message "Starteam %s operation: [ %s %s %s ]"
operation-string
(concat starteam-executable " " command " -x -p \""
(starteam-get-login-info) "/" path "\"" )
(starteam-stringlist-to-single-string args) file)
nil)
(let ((bname (concat
"*Starteam [" command "] "
path
"*")))
(save-excursion
(get-buffer-create bname)
(set-buffer bname)
(toggle-read-only -1)
(erase-buffer)
)
;(message "starteam executing [%s %s %s]" (concat starteam-executable "
" command " -x -p \"" (starteam-get-login-info) "/" path "\"" )
(starteam-stringlist-to-single-string args) file)
(if args
;(apply 'call-process "C:\\winnt\\system32\\cmd.exe" nil bname nil
"/C" "echo" "ECHOING: "
(apply 'call-process starteam-executable nil bname nil
command
"-nologo" ; don't print executable version
"-x" ; non-interactive
"-p"
(concat (starteam-get-login-info) "/" path)
(append (starteam-remove-bad-starteam-args args)
(if (and file (> (length file) 0))
(list file)
(list)
))
)
;(apply 'call-process "C:\\winnt\\system32\\cmd.exe" nil bname nil
"/C" "echo" "BOO"
(apply 'call-process starteam-executable nil bname nil
command
"-nologo"
"-x"
"-p"
(concat (starteam-get-login-info) "/" path)
(if file (list file) nil)
)
)
(save-excursion
(set-buffer bname)
(goto-char (point-min))
)
bname))
------------------------
Matthew Inger
in...@sy...
Software Developer
Synygy, Inc
610-664-7433 x7770
|
|
From: Matthew S. <lpm...@ih...> - 2002-12-13 15:34:04
|
think i have something here:
alter the alist to be something like:
(list
(list "E:/SynygyCompensation10/WEB-INF"
"E:/SynygyCompensation10"
"Synygy Compensation/Synygy Compensation")
(list "E:/SynygyCompensation10/"
"E:/SynygyCompensation10"
"Synygy Compensation/Synygy Compensation")
)
Yes, I know this isn't really an alist, but it's close enough,
and we can work out the exact details later. Noticed, I've
added another directory as the second (1th) item in the list.
This is what the working directory should be specified as for
files/directories which match the path in the 0th element.
When you get a path that matches the 0th item, rather than just
use that 0th item as it's working folder (the -rp flag), use the
1th item instead. To account for the change in the list, I've
modified the two functions below. The first one i modified to
account for the change in the list structure and where the items
are positioned. The second one I changed to account for the change
in list structure, and to use the 1th item in the -rp flag instead
of the 0th.
(defun starteam-get-starteam-path-from-local-path (local-dir)
"Given a local directory, attempts to convert it to a starteam path
based upon the values in starteam-to-directory-alist. If the given directory
cannot be reconciled to a starteam path, 'error is called.
For example, assume that starteam-to-directory-alist is set up as follows:
(setq starteam-to-directory-alist (list (cons \"^X:/test\"
\"test/myview\" )))
In this case
(starteam-get-starteam-path-from-local-path \"X:/test/a/b\")
returns \"test/myview/a/b\"
"
(let ((still-looking t)
(path nil))
(mapcar (function (lambda (x)
(if (and still-looking
(string-match (nth 0 x) local-dir))
(setq still-looking nil
path (concat (nth 2 x)
(substring local-dir
(match-end 0))))
nil)))
starteam-to-directory-alist)
(if (not path)
(error "Could match local path %s to path in any known Starteam
view" local-dir)
path)
))
(defun starteam-get-working-dir-from-local-path (local-dir)
"Given a local directory, attempts to determine the starteam working
directory
based upon the values in starteam-to-directory-alist. If the given directory
cannot be reconciled to a starteam path, 'error is called.
For example, assume that starteam-to-directory-alist is set up as follows:
(setq starteam-to-directory-alist (list (cons \"^X:/test\"
\"test/myview\" )))
In this case, both
(starteam-get-working-dir-from-local-path \"X:/test/a/b/foo.java\")
and
(starteam-get-working-dir-from-local-path \"X:/test/g/bar.c++\")
return \"X:/test\"
"
(let* ((working-dir nil)
(still-looking t))
(mapcar (lambda (x)
(if (and still-looking
(string-match (nth 0 x) local-dir))
(setq still-looking nil
working-dir (nth 1 x))
;;(substring local-dir
;; (match-beginning 0)
;; (match-end 0)))
nil))
starteam-to-directory-alist)
(if (not working-dir)
(error "Could match local path %s to path in any known Starteam
view" local-dir)
working-dir)
))
(defun starteam-output-buffer-contains (buffer regexp)
"Searches the given buffer for the occurence of the given regular
_expression; returns t if the regexp was found, and nil otherwise."
(if starteam-debug (message "Searching buffer %s for regexp %s"
buffer regexp))
(save-excursion
(set-buffer buffer)
(goto-char (point-min))
(if (re-search-forward regexp nil t)
t
nil)
))
------------------------
Matthew Inger
Software Developer
Synygy, Inc
-----Original Message-----
From: Matthew Smith
Sent: Thursday, December 12, 2002 5:38 PM
To: Inger, Matthew
Subject: RE: starteam.el
Of course our StarTeam server is down so I can't look
at it today. If you figure it out before I do, let me
know.
--- "Inger, Matthew" wrote:
> The problem is basically that the "working folder"
> attribute in Star Team is not always consistent with
> the
> repository structure. For instance.
>
> Synygy Compensation
> src
>
> The Working folder for this directory is
> WEB-INF/src
>
> So that when you check out a file it goes to
> WEB-INF/src directory.
>
> What happens is if I put the "WEB-INF" in the
> alist, the first dir listing works, but it
> fills in the path as:
>
>
>
E:\SynygyCompensation10\WEB-INF\WEB-INF\com\synygy\....
>
> From that point on, I can't do anything with any of
> the directories or files in dired mode.
>
> What the starteam library needs to understand is
> that
> each individual directory in the repository can have
> a
> working directory assinged to it. ie. it's a
> mapping
>
> Repository Directory Working
> Directory
> -------------------------------
> -------------------------------
> /src
> <Root>/WEB-INF/src
> /tests
> <Root>/WEB-INF/src/tests/
> /Jsp <Root/Jsp
>
> And there needs to be translations in both
> directions.
> When you have a given file on disk, you have to
> translate it
> back to it's appropriate name in the repository, and
> when you
> have a repository file, you need to be able to get
> it's physical
> name on the disk. And the starteam library needs to
> handle all
> this behind the scenes.
>
> Ideally, I should just be able to set my alist to:
>
> (list
> (cons "E:/SynygyCompensation10/"
> "Synygy Compensation/Synygy Compensation"))
>
> And have everything work. Then, when I do a
> directory listing
> on "E:/SynygyCompensation10/WEB-INF/src" it would
> realize that the
> appropriate translation is to list "src".
>
> This all make sense?
|