Mailing List Archive

PythonWin VSS Integration
I've just finished setting up visual source safe here, and thought that I
would take the opportunity to see what PythonWin's integration was like.
However, not knowing what it is supposed to do, I don't know what I am
supposed to do, or whether it is working. I was assuming that the
integration would be something similar to what visual studio does, i.e.,
when I attempt to edit a file in PythonWin, visual source safe would prompt
me to checkout the file. That doesn't seem to be the case.

So, any hints? What does visual source safe integration mean?

Thanks,
Mike
PythonWin VSS Integration [ In reply to ]
Mike C. Fletcher wrote in message <002a01bec203$1fc90230
[Laments about Pythonwin and Source Safe]

>So, any hints? What does visual source safe integration mean?

Well, it _should_ give you some clues. Note that you need to restart
Pythonwin before the option will take effect. Also note that the file must
be marked read-only on the disk.

Once enabled, and assuming VSS is installed correctly, the most likely error
message you will see is something like "this directory is not configured for
VSS". [.Once the option is checked, you should get _some_ message on a
read-only file]

In this case, you need a "mssccprj.scc" file either in the file's directory
or a parent directory. This is the same name and format as VB uses -
basically a Windows INI file. A section [Python] with entry
"Project=ProjectName" is referenced. The project name is the name of the
VSS project the Python code attempts to check the file out from. If the
.scc file is in a parent directory, the correct relative VSS path is built -
so if your file system matches your VSS structure, you only need a single
.scc file in the VSS "root" directory.

Hope this makes sense.

Mark.
>
>Thanks,
>Mike
>
PythonWin VSS Integration [ In reply to ]
Spent the morning playing with this. The mssccprj.scc file was not there,
adding it to the directory allowed errors to occur. The errors were of the
type can't find this item. After verifying that I was using the proper
format for project name, spent some time spelunking on MSDN to discover how
SourceSafe decides which database to load. Since PythonWin does not check
for a non-default database, SourceSafe searches in this manner (quoted from
MSDN, copyright Microsoft):

1 Search for srcsafe.ini in the directory where ssapi.dll is located.

2 Search for srcsafe.ini in each directory of the path to ssapi.dll. In
other words, if ssapi.dll is located in
C:\Folder1\Folder2\Folder3\SSAPI.DLL, Folder3, Folder2, Folder1 and C:\ are
searched (in that order).

3 Search for srcsafe.ini in the location indicated by the named value "API
Current Database" in the registry key
HKEY_LOCAL_MACHINE\Software\Microsoft\SourceSafe.

4 Search for srcsafe.ini in the location indicated by the named value
"SCCProviderPath" in the registry key
HKEY_LOCAL_MACHINE\Software\Microsoft\SourceSafe.

I have as of yet been unable to get the SourceSafe Open automation command
to accept a non-default argument, so I cannot offer a patch to vss.py. I've
worked around problem by renaming the default database's INI file, and
putting the path to my non-default database into the key mentioned in step
three above. Everything now works as expected (that is, attempts to alter
the file prompt for check out and do perform check).

Okay, have spent far more time on this than I was looking to, enjoy
yourselves,
Mike

Mark Hammond <MHammond@skippinet.com.au> wrote in message
news:7la6vj$rh0$1@m2.c2.telstra-mm.net.au...
> Mike C. Fletcher wrote in message <002a01bec203$1fc90230
> [Laments about Pythonwin and Source Safe]
>
> >So, any hints? What does visual source safe integration mean?
>
> Well, it _should_ give you some clues. Note that you need to restart
> Pythonwin before the option will take effect. Also note that the file
must
> be marked read-only on the disk.
>
> Once enabled, and assuming VSS is installed correctly, the most likely
error
> message you will see is something like "this directory is not configured
for
> VSS". [.Once the option is checked, you should get _some_ message on a
> read-only file]
>
> In this case, you need a "mssccprj.scc" file either in the file's
directory
> or a parent directory. This is the same name and format as VB uses -
> basically a Windows INI file. A section [Python] with entry
> "Project=ProjectName" is referenced. The project name is the name of the
> VSS project the Python code attempts to check the file out from. If the
> .scc file is in a parent directory, the correct relative VSS path is
built -
> so if your file system matches your VSS structure, you only need a single
> .scc file in the VSS "root" directory.
>
> Hope this makes sense.
>
> Mark.
> >
> >Thanks,
> >Mike
> >
>
>
>