[Starteam-el-users] No support for Working Folders being set
Status: Beta
Brought to you by:
m0smith
|
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?
|