|
From: Clayton H. <cla...@sp...> - 2004-12-09 15:27:57
|
Hi Thomas,
Yeah, that is a bit of ugliness. The whole Folders/ FoldersToUpdate =
needs to be reworked actually. The basic idea was to store an entire =
list of the CVS Entries Folders in the Folders property and then filter =
that and put it in the FoldersToUpdate property. I have filed a bug on =
this (1082194) and the simple solution will probably be to just make the =
two properties equal if there are no issues anywhere else in the =
library. =20
In the meantime though if you populate the FoldersToUpdate Property =
instead that should fix your issue.
I have also added a check to see if the FoldersToUpdate is null and if =
so the method just returns which is better than the NullPointer.
Cheers,
Clayton
-----Original Message-----
From: Thomas Guillemin [mailto:tg...@ja...]
Sent: Thu 12/9/2004 3:42 AM
To: Clayton Harbour
Cc: sha...@li...
Subject: Re: [Sharpcvslib-users] Simple question
hi hi
thanks for that you're great clayton, now my committing function seems=20
to work fine.
Now i'm still having problems with my update function, which begins with =
the update of one file (still the index.xml):
if (File.Exists(IndexPath))
{
string pathdir =3D vpath.Substring(0,=20
IndexPath.LastIndexOf("\\"));
string wdirname =3D pathdir.Substring(0,=20
pathdir.LastIndexOf("\\"));
string reldirname =3D=20
pathdir.Substring(pathdir.LastIndexOf("\\")+1, pathdir.Length -=20
pathdir.LastIndexOf("\\")-1);
// We update the index file to the desired revision
// (the last one by default)
wd =3D new WorkingDirectory(cvsroot, wdirname, =
reldirname);
if (Revision !=3D "" && Revision !=3D "Last Version")
{
wd.Revision =3D Revision;
}
DirectoryInfo dir =3D new=20
DirectoryInfo(Path.Combine(pathdir, "CVS"));
FileInfo reposfile =3D new FileInfo(pathdir +=20
"\\CVS\\Repository");
Folder folder =3D new Folder();
folder.Repository =3D Repository.Load(reposfile);
Entries entries =3D Entries.Load(dir);
Entry entry =3D entries[vpath];
folder.Entries.Add(pathdir, entry);
wd.Folders.Add(pathdir, folder);
//Debug.WriteLine(wd.FoldersToUpdate.Length.ToString());
cnx =3D new CVSServerConnection(wd);
cnx.Connect(wd, userpass);
RegisterListenEvents(cnx);
UpdateCommand2 cmd =3D new UpdateCommand2(wd);
cmd.Execute(cnx);
It crashes on UpdateCommand2.Execute(): =20
workingDirectory.FoldersToUpdate is NULL and so i get a=20
nullreferenceexception...
Do you know how i must proceed ?
Thomas
Clayton Harbour wrote:
>Hi Thomas, just checking back in if you are still having an issue with =
this. I have been looking at the error message below and it looks like =
the Repository folder may have an extra empty line near the end. I =
added a trim on December 3rd that might take care if this if you could =
try it again.
>
>Cheers,
>
>Clayton
>
>
>-----Original Message-----
>From: Thomas Guillemin [mailto:tg...@ja...]
>Sent: Mon 12/6/2004 7:43 AM
>To: Clayton Harbour
>Cc: sha...@li...
>Subject: Re: [Sharpcvslib-users] Simple question
>i'm using the lib, updated last week (i'm waiting for sourceforge to be =
>up again and i'll update then), so no cvs.exe, and the server is a =
cvsnt=20
>on windows xp, :pserver:.
>I was only listening to response events, not the request ones. I have=20
>added it, and here is what i get from my TextBox now:
>REQUEST: [Valid-responses ok error Valid-requests Checked-in New-entry=20
>Updated Created Merged Mod-time Removed Set-static-directory=20
>Clear-static-directory Set-sticky Clear-sticky Module-expansion M E MT]
> --> []
>REQUEST: [valid-requests]
> --> []
>RESPONSE: Root Valid-responses valid-requests Directory Max-dotdot=20
>Static-directory Sticky Entry EntryExtra Kopt Checkin-time Modified=20
>Is-modified UseUnchanged Unchanged Notify NotifyUser Questionable Utf8=20
>Argument Argumentx Global_option Gzip-stream wrapper-sendme-rcsOptions=20
>Set Rename VirtualRepository expand-modules ci co chown setowner =
setperm=20
>chacl setacl lsacl passwd info update diff log rlog add remove=20
>update-patches status ls rdiff tag rtag import admin export history=20
>release watch-on watch-off watch-add watch-remove watchers editors init =
>annotate rannotate noop version Rootless-stream-modification=20
>Kerberos-encrypt Gssapi-encrypt Protocol-encrypt Gssapi-authenticate=20
>Protocol-authenticate read-cvsrc read-cvsrc2 read-cvsignore=20
>read-cvswrappers Error-If-Reader Valid-RcsOptions
> - ( ValidRequestsResponse )REQUEST: [UseUnchanged]
> --> []
>REQUEST: [Root /CVSRep]
> --> []
>REQUEST: [Global_option -q]
> --> []
>REQUEST: [Argument -m]
> --> []
>REQUEST: [Argument LOG MESSAGE]
> --> []
>REQUEST: [Argument --]
> --> []
>REQUEST: [Directory .]
> --> [/CVSRep/Test
>]
> --> []
> --> []
>REQUEST: [Entry /Index.xml/1.6/Mon Dec 6 16:32:25 2004+Fri Dec 3=20
>12:03:15 2004//T1.6]
> --> []
>REQUEST: [Modified Index.xml]
> --> [u=3Drw,g=3Drw,o=3Drw]
> --> []
>REQUEST: [Directory .]
> --> [/CVSRep/Test
>]
> --> []
> --> []
>REQUEST: [Argument Index.xml]
> --> []
>REQUEST: [ci]
> --> []
>ERROR: cvs server: M unrecognized request `'
>
>does that put some light on the scene ?
>
>Clayton Harbour wrote:
>
> =20
>
>>Which version of the client are you using Thomas? Also which version=20
>>of server are you connecting to? If you are using the code from cvs=20
>>could you do an update, sometimes it takes a while for sourceforge's=20
>>development cvs server to replicate to the anonymous server. Also=20
>>verify that you are handling the following events:
>> serverConn.RequestMessageEvent +=3D
>> new MessageEventHandler(Writer.WriteLine);
>> serverConn.ResponseMessageEvent +=3D
>> new MessageEventHandler(Writer.WriteLine);
>>=20
>>This will print out all requests and responses. What I am suspecting=20
>>is that there is a CaseRequest being sent that the server does not=20
>>like...at least that was an issue I came across l week. Let me know=20
>>what you find out.
>>=20
>>=20
>>Cheers,
>>=20
>>Clayton
>>
>> -----Original Message-----
>> *From:* Thomas Guillemin [mailto:tg...@ja...]
>> *Sent:* December 6, 2004 1:53 AM
>> *To:* Clayton Harbour
>> *Cc:* sha...@li...
>> *Subject:* Re: [Sharpcvslib-users] Simple question
>>
>> hm, it behaves exactly the same with this line instead.
>> and i still get [cvs server: M unrecognized request `'] in the =
end...
>>
>> Clayton Harbour wrote:
>>
>> =20
>>
>>> Hi Thomas,
>>> =20
>>> I think this line:
>>> FileInfo file =3D new FileInfo(pathdir + \\CVS =
<file://%5C%5CCVS>);
>>> should be:
>>> DirectoryInfo dir =3D new DirectoryInfo(Path.Combine(pathdir,
>>> "CVS");
>>> =20
>>> I am surprised that you don't get an error when you do an
>>> Entries entries =3D Entries.Load(file);
>>> =20
>>> There is no CvsFileNotFoundException being thrown? Are you sure
>>> you are not trapping this error silently?
>>> =20
>>>
>>> -----Original Message-----
>>> *From:* Thomas Guillemin [mailto:tg...@ja...]
>>> *Sent:* December 2, 2004 8:12 AM
>>> *To:* Clayton Harbour
>>> *Cc:* sha...@li...
>>> *Subject:* Re: [Sharpcvslib-users] Simple question
>>>
>>> mh i'm not sure to understand...
>>> here is my code:
>>>
>>> (...stuff...)
>>> wd =3D new WorkingDirectory(CVSRoot, wdirname, reldirname);
>>> cnx =3D new CVSServerConnection(wd);
>>> cnx.Connect(wd, userpass);
>>> (...stuff...)
>>> then:
>>> pathdir is the full local dir path where the file i want to
>>> commit is stored (ie: D:\Dev\CVSTest\Test\)
>>> vpath is the path for the file (ie:
>>> D:\Dev\CVSTest\Test\Index.xml)
>>>
>>> wd.Folders.Clear();
>>> FileInfo file =3D new FileInfo(pathdir + =
"\\CVS");
>>> FileInfo reposfile =3D new FileInfo(pathdir +
>>> "\\CVS\\Repository");
>>> Folder folder =3D new Folder();
>>> folder.Repository =3D =
Repository.Load(reposfile);
>>> Entries entries =3D Entries.Load(file);
>>> Entry entry =3D entries[vpath];
>>> folder.Entries.Add(pathdir, entry);
>>> wd.Folders.Add(pathdir, folder);
>>> cnx =3D new CVSServerConnection(wd);
>>> cnx.Connect(wd, userpass);
>>> CommitCommand2 cmd2 =3D new =
CommitCommand2(wd);
>>> cmd2.Execute(cnx);
>>> cnx.Close();
>>>
>>> it makes no error, but no message at all in my textbox (where
>>> i print errors and responses as well).
>>> do you think this will work at all, and commit only the file
>>> i want ? (Index.xml)
>>>
>>> btw, i have to do exactly the same (with the revision number
>>> for the specified file added) for updating some files.
>>>
>>> Clayton Harbour wrote:
>>>
>>> =20
>>>
>>>>Hi Thomas,
>>>>
>>>>The code would look something like this:
>>>> Folder folder =3D new Folder();
>>>> Entries entries =3D new Entries.Load(file);
>>>> Entry entry =3D entries[file];
>>>> Folder.Entries.Add(entry);
>>>> WorkingDirectory wd.Folders.Add(folder);
>>>>
>>>>I have not compiled this code so you may have to play with it =
somewhat.
>>>>The basic idea is that you have to populate the Folders object on =
the
>>>>working directory with the Entry you want to update.
>>>>
>>>>
>>>>Cheers,
>>>>
>>>>Clayton
>>>>
>>>>=20
>>>>
>>>> =20
>>>>
>>>>>-----Original Message-----
>>>>>From: Thomas Guillemin [mailto:tg...@ja...]=20
>>>>>Sent: December 2, 2004 5:45 AM
>>>>>To: sha...@li...
>>>>>Subject: [Sharpcvslib-users] Simple question
>>>>>
>>>>>
>>>>>Hi
>>>>>Can someone show me how i must proceed to update/commit only=20
>>>>>one file ?=20
>>>>>(with UpdateCommand2/CommitCommand2)
>>>>>Thanks
>>>>>
>>>>>Thomas
>>>>>
>>>>>
>>>>>-------------------------------------------------------
>>>>>SF email is sponsored by - The IT Product Guide
>>>>>Read honest & candid reviews on hundreds of IT Products from=20
>>>>>real users. Discover which products truly live up to the=20
>>>>>hype. Start reading now.=20
>>>>>http://productguide.itmanagersjournal.com/
>>>>>_______________________________________________
>>>>>Sharpcvslib-users mailing list =
Sha...@li...
>>>>>https://lists.sourceforge.net/lists/listinfo/sharpcvslib-users
>>>>>
>>>>> =20
>>>>>
>>>>> =20
>>>>>
>>>>-------------------------------------------------------
>>>>SF email is sponsored by - The IT Product Guide
>>>>Read honest & candid reviews on hundreds of IT Products from real =
users.
>>>>Discover which products truly live up to the hype. Start reading =
now.=20
>>>>http://productguide.itmanagersjournal.com/
>>>>_______________________________________________
>>>>Sharpcvslib-users mailing list
>>>>Sha...@li...
>>>>https://lists.sourceforge.net/lists/listinfo/sharpcvslib-users
>>>>
>>>>=20
>>>>
>>>> =20
>>>>
>
>
>
>
> =20
>
|