Re: Patch for 1.3.X: vc-backend file quoting+CVS::checkOut

2005-03-29 Thread Jean-Marc Lasgouttes
 Jean-Marc == Jean-Marc Lasgouttes [EMAIL PROTECTED] writes:

Jean-Marc Here are the patch I propose to apply. We could have gone a
Jean-Marc bit further and use QuoteName on log messages too, instead
Jean-Marc of the explicit quoting.

Jean-Marc Lars, still OK?

Applied now.

JMarc


Re: Patch for 1.3.X: vc-backend file quoting+CVS::checkOut

2005-03-29 Thread Jean-Marc Lasgouttes
> "Jean-Marc" == Jean-Marc Lasgouttes <[EMAIL PROTECTED]> writes:

Jean-Marc> Here are the patch I propose to apply. We could have gone a
Jean-Marc> bit further and use QuoteName on log messages too, instead
Jean-Marc> of the explicit "quoting".

Jean-Marc> Lars, still OK?

Applied now.

JMarc


Re: Patch for 1.3.X: vc-backend file quoting+CVS::checkOut

2005-03-26 Thread Lars Gullik Bjnnes
Jean-Marc Lasgouttes [EMAIL PROTECTED] writes:

| Here are the patch I propose to apply. We could have gone a bit
| further and use QuoteName on log messages too, instead of the explicit
| quoting. 

| Lars, still OK?

yes

-- 
Lgb



Re: Patch for 1.3.X: vc-backend file quoting+CVS::checkOut

2005-03-26 Thread Lars Gullik Bjønnes
Jean-Marc Lasgouttes <[EMAIL PROTECTED]> writes:

| Here are the patch I propose to apply. We could have gone a bit
| further and use QuoteName on log messages too, instead of the explicit
| "quoting". 
>
| Lars, still OK?

yes

-- 
Lgb



Re: Patch for 1.3.X: vc-backend file quoting+CVS::checkOut

2005-03-25 Thread Jean-Marc Lasgouttes

Here are the patch I propose to apply. We could have gone a bit
further and use QuoteName on log messages too, instead of the explicit
quoting. 

Lars, still OK?

JMarc

Index: src/ChangeLog
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/ChangeLog,v
retrieving revision 1.1021.2.74
diff -u -p -r1.1021.2.74 ChangeLog
--- src/ChangeLog	25 Mar 2005 15:35:48 -	1.1021.2.74
+++ src/ChangeLog	25 Mar 2005 16:06:47 -
@@ -1,3 +1,8 @@
+2005-03-25  Stephan Witt  [EMAIL PROTECTED]
+
+	* vc-backend.C: use QuoteName to protect file names wherever
+	necessary. 
+
 2005-03-10  Jean-Marc Lasgouttes  [EMAIL PROTECTED]
 
 	* lyxrc.C (setDefaults, read, output): add support for
Index: src/vc-backend.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/vc-backend.C,v
retrieving revision 1.36.2.3
diff -u -p -r1.36.2.3 vc-backend.C
--- src/vc-backend.C	5 Jan 2005 15:53:17 -	1.36.2.3
+++ src/vc-backend.C	25 Mar 2005 16:06:47 -
@@ -94,8 +94,7 @@ string const RCS::find_file(string const
 void RCS::retrieve(string const  file)
 {
 	lyxerr[Debug::LYXVC]  LyXVC::RCS: retrieve.\n\t  file  endl;
-	VCS::doVCCommand(co -q -r \
-			 + file + '',
+	VCS::doVCCommand(co -q -r  + QuoteName(file),
 			 string());
 }
 
@@ -168,9 +167,8 @@ void RCS::registrer(string const  msg)
 {
 	string cmd = ci -q -u -i -t-\;
 	cmd += msg;
-	cmd += \ \;
-	cmd += OnlyFilename(owner_-fileName());
-	cmd += '';
+	cmd += \ ;
+	cmd += QuoteName(OnlyFilename(owner_-fileName()));
 	doVCCommand(cmd, owner_-filePath());
 	reload();
 }
@@ -178,8 +176,8 @@ void RCS::registrer(string const  msg)
 
 void RCS::checkIn(string const  msg)
 {
-	doVCCommand(ci -q -u -m\ + msg + \ \
-		+ OnlyFilename(owner_-fileName()) + '',
+	doVCCommand(ci -q -u -m\ + msg + \ 
+		+ QuoteName(OnlyFilename(owner_-fileName())),
 		owner_-filePath());
 	reload();
 }
@@ -188,8 +186,7 @@ void RCS::checkIn(string const  msg)
 void RCS::checkOut()
 {
 	owner_-markClean();
-	doVCCommand(co -q -l \
-		+ OnlyFilename(owner_-fileName()) + '',
+	doVCCommand(co -q -l  + QuoteName(OnlyFilename(owner_-fileName())),
 		owner_-filePath());
 	reload();
 }
@@ -197,8 +194,8 @@ void RCS::checkOut()
 
 void RCS::revert()
 {
-	doVCCommand(co -f -u + version() +  \
-		+ OnlyFilename(owner_-fileName()) + '',
+	doVCCommand(co -f -u + version() +  
+		+ QuoteName(OnlyFilename(owner_-fileName())),
 		owner_-filePath());
 	// We ignore changes and just reload!
 	owner_-markClean();
@@ -209,16 +206,16 @@ void RCS::revert()
 void RCS::undoLast()
 {
 	lyxerr[Debug::LYXVC]  LyXVC: undoLast  endl;
-	doVCCommand(rcs -o + version() +  \
-		+ OnlyFilename(owner_-fileName()) + '',
+	doVCCommand(rcs -o + version() +  
+		+ QuoteName(OnlyFilename(owner_-fileName())),
 		owner_-filePath());
 }
 
 
 void RCS::getLog(string const  tmpf)
 {
-	doVCCommand(rlog \
-		+ OnlyFilename(owner_-fileName()) + \  
+	doVCCommand(rlog 
+		+ QuoteName(OnlyFilename(owner_-fileName())) +   
 		+ tmpf, owner_-filePath());
 }
 
@@ -308,8 +305,8 @@ void CVS::scanMaster()
 
 void CVS::registrer(string const  msg)
 {
-	doVCCommand(cvs -q add -m \ + msg + \ \
-		+ OnlyFilename(owner_-fileName()) + '',
+	doVCCommand(cvs -q add -m \ + msg + \ 
+		+ QuoteName(OnlyFilename(owner_-fileName())),
 		owner_-filePath());
 	reload();
 }
@@ -317,8 +314,8 @@ void CVS::registrer(string const  msg)
 
 void CVS::checkIn(string const  msg)
 {
-	doVCCommand(cvs -q commit -m \ + msg + \ \
-		+ OnlyFilename(owner_-fileName()) + '',
+	doVCCommand(cvs -q commit -m \ + msg + \ 
+		+ QuoteName(OnlyFilename(owner_-fileName())),
 		owner_-filePath());
 	reload();
 }
@@ -335,9 +332,9 @@ void CVS::revert()
 {
 	// Reverts to the version in CVS repository and
 	// gets the updated version from the repository.
-	string const fil = OnlyFilename(owner_-fileName());
+	string const fil = QuoteName(OnlyFilename(owner_-fileName()));
 
-	doVCCommand(rm -f \ + fil + \; cvs update \ + fil + '',
+	doVCCommand(rm -f  + fil + ; cvs update  + fil,
 		owner_-filePath());
 	owner_-markClean();
 	reload();
@@ -355,7 +352,7 @@ void CVS::undoLast()
 
 void CVS::getLog(string const  tmpf)
 {
-	doVCCommand(cvs log \
-		+ OnlyFilename(owner_-fileName()) + \   + tmpf,
+	doVCCommand(cvs log 
+		+ QuoteName(OnlyFilename(owner_-fileName())) ++ tmpf,
 		owner_-filePath());
 }
Index: src/ChangeLog
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/ChangeLog,v
retrieving revision 1.2142
diff -u -p -r1.2142 ChangeLog
--- src/ChangeLog	25 Mar 2005 15:27:27 -	1.2142
+++ src/ChangeLog	25 Mar 2005 16:09:09 -
@@ -1,3 +1,8 @@
+2005-03-25  Stephan Witt  [EMAIL PROTECTED]
+
+	* vc-backend.C: use QuoteName to protect file names wherever
+	necessary. 
+
 2005-03-14  Jean-Marc Lasgouttes  [EMAIL PROTECTED]
 
 	* 

Re: Patch for 1.3.X: vc-backend file quoting+CVS::checkOut

2005-03-25 Thread Jean-Marc Lasgouttes

Here are the patch I propose to apply. We could have gone a bit
further and use QuoteName on log messages too, instead of the explicit
"quoting". 

Lars, still OK?

JMarc

Index: src/ChangeLog
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/ChangeLog,v
retrieving revision 1.1021.2.74
diff -u -p -r1.1021.2.74 ChangeLog
--- src/ChangeLog	25 Mar 2005 15:35:48 -	1.1021.2.74
+++ src/ChangeLog	25 Mar 2005 16:06:47 -
@@ -1,3 +1,8 @@
+2005-03-25  Stephan Witt  <[EMAIL PROTECTED]>
+
+	* vc-backend.C: use QuoteName to protect file names wherever
+	necessary. 
+
 2005-03-10  Jean-Marc Lasgouttes  <[EMAIL PROTECTED]>
 
 	* lyxrc.C (setDefaults, read, output): add support for
Index: src/vc-backend.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/vc-backend.C,v
retrieving revision 1.36.2.3
diff -u -p -r1.36.2.3 vc-backend.C
--- src/vc-backend.C	5 Jan 2005 15:53:17 -	1.36.2.3
+++ src/vc-backend.C	25 Mar 2005 16:06:47 -
@@ -94,8 +94,7 @@ string const RCS::find_file(string const
 void RCS::retrieve(string const & file)
 {
 	lyxerr[Debug::LYXVC] << "LyXVC::RCS: retrieve.\n\t" << file << endl;
-	VCS::doVCCommand("co -q -r \""
-			 + file + '"',
+	VCS::doVCCommand("co -q -r " + QuoteName(file),
 			 string());
 }
 
@@ -168,9 +167,8 @@ void RCS::registrer(string const & msg)
 {
 	string cmd = "ci -q -u -i -t-\"";
 	cmd += msg;
-	cmd += "\" \"";
-	cmd += OnlyFilename(owner_->fileName());
-	cmd += '"';
+	cmd += "\" ";
+	cmd += QuoteName(OnlyFilename(owner_->fileName()));
 	doVCCommand(cmd, owner_->filePath());
 	reload();
 }
@@ -178,8 +176,8 @@ void RCS::registrer(string const & msg)
 
 void RCS::checkIn(string const & msg)
 {
-	doVCCommand("ci -q -u -m\"" + msg + "\" \""
-		+ OnlyFilename(owner_->fileName()) + '"',
+	doVCCommand("ci -q -u -m\"" + msg + "\" "
+		+ QuoteName(OnlyFilename(owner_->fileName())),
 		owner_->filePath());
 	reload();
 }
@@ -188,8 +186,7 @@ void RCS::checkIn(string const & msg)
 void RCS::checkOut()
 {
 	owner_->markClean();
-	doVCCommand("co -q -l \""
-		+ OnlyFilename(owner_->fileName()) + '"',
+	doVCCommand("co -q -l " + QuoteName(OnlyFilename(owner_->fileName())),
 		owner_->filePath());
 	reload();
 }
@@ -197,8 +194,8 @@ void RCS::checkOut()
 
 void RCS::revert()
 {
-	doVCCommand("co -f -u" + version() + " \""
-		+ OnlyFilename(owner_->fileName()) + '"',
+	doVCCommand("co -f -u" + version() + " "
+		+ QuoteName(OnlyFilename(owner_->fileName())),
 		owner_->filePath());
 	// We ignore changes and just reload!
 	owner_->markClean();
@@ -209,16 +206,16 @@ void RCS::revert()
 void RCS::undoLast()
 {
 	lyxerr[Debug::LYXVC] << "LyXVC: undoLast" << endl;
-	doVCCommand("rcs -o" + version() + " \""
-		+ OnlyFilename(owner_->fileName()) + '"',
+	doVCCommand("rcs -o" + version() + " "
+		+ QuoteName(OnlyFilename(owner_->fileName())),
 		owner_->filePath());
 }
 
 
 void RCS::getLog(string const & tmpf)
 {
-	doVCCommand("rlog \""
-		+ OnlyFilename(owner_->fileName()) + "\" > "
+	doVCCommand("rlog "
+		+ QuoteName(OnlyFilename(owner_->fileName())) + " > "
 		+ tmpf, owner_->filePath());
 }
 
@@ -308,8 +305,8 @@ void CVS::scanMaster()
 
 void CVS::registrer(string const & msg)
 {
-	doVCCommand("cvs -q add -m \"" + msg + "\" \""
-		+ OnlyFilename(owner_->fileName()) + '"',
+	doVCCommand("cvs -q add -m \"" + msg + "\" "
+		+ QuoteName(OnlyFilename(owner_->fileName())),
 		owner_->filePath());
 	reload();
 }
@@ -317,8 +314,8 @@ void CVS::registrer(string const & msg)
 
 void CVS::checkIn(string const & msg)
 {
-	doVCCommand("cvs -q commit -m \"" + msg + "\" \""
-		+ OnlyFilename(owner_->fileName()) + '"',
+	doVCCommand("cvs -q commit -m \"" + msg + "\" "
+		+ QuoteName(OnlyFilename(owner_->fileName())),
 		owner_->filePath());
 	reload();
 }
@@ -335,9 +332,9 @@ void CVS::revert()
 {
 	// Reverts to the version in CVS repository and
 	// gets the updated version from the repository.
-	string const fil = OnlyFilename(owner_->fileName());
+	string const fil = QuoteName(OnlyFilename(owner_->fileName()));
 
-	doVCCommand("rm -f \"" + fil + "\"; cvs update \"" + fil + '"',
+	doVCCommand("rm -f " + fil + "; cvs update " + fil,
 		owner_->filePath());
 	owner_->markClean();
 	reload();
@@ -355,7 +352,7 @@ void CVS::undoLast()
 
 void CVS::getLog(string const & tmpf)
 {
-	doVCCommand("cvs log \""
-		+ OnlyFilename(owner_->fileName()) + "\" > " + tmpf,
+	doVCCommand("cvs log "
+		+ QuoteName(OnlyFilename(owner_->fileName())) + " > " + tmpf,
 		owner_->filePath());
 }
Index: src/ChangeLog
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/ChangeLog,v
retrieving revision 1.2142
diff -u -p -r1.2142 ChangeLog
--- src/ChangeLog	25 Mar 2005 15:27:27 -	1.2142
+++ src/ChangeLog	25 Mar 2005 16:09:09 -
@@ -1,3 +1,8 @@

Re: Patch for 1.3.X: vc-backend file quoting+CVS::checkOut

2005-03-21 Thread Jean-Marc Lasgouttes
 Lars == Lars Gullik Bjønnes [EMAIL PROTECTED] writes:

Lars | May I kindly ask for the result of our discussion? | I
Lars answered all of your questions and now I cannot see how to
Lars proceed.

Lars For 1.3. J-M is calling the shots.

I propose to commit the QuoteName changes to 1.3.x and 1.4.0cvs, since
they seem obvious enough. 

Lars, OK?

Lars I think it is ok, but I am a bit worried about having checkout
Lars == edit.

Lars Also I am a bit afraid of different CVS usage pattersn. I .fex.
Lars never use 'cvs edit' and always work in the 'shared' state. Will
Lars this way or working have the potential of being confused with
Lars checkouts and such.

We can keep this for later, then. I also use checkout and know nothing
about edit...

What does emacs do?

JMarc


Re: Patch for 1.3.X: vc-backend file quoting+CVS::checkOut

2005-03-21 Thread Lars Gullik Bjønnes
Jean-Marc Lasgouttes [EMAIL PROTECTED] writes:

 Lars == Lars Gullik Bjønnes [EMAIL PROTECTED] writes:

| Lars | May I kindly ask for the result of our discussion? | I
| Lars answered all of your questions and now I cannot see how to
| Lars proceed.

| Lars For 1.3. J-M is calling the shots.

| I propose to commit the QuoteName changes to 1.3.x and 1.4.0cvs, since
| they seem obvious enough. 

| Lars, OK?

ok

-- 
Lgb



Re: Patch for 1.3.X: vc-backend file quoting+CVS::checkOut

2005-03-21 Thread Stephan Witt
Lars Gullik Bjønnes wrote:
Jean-Marc Lasgouttes [EMAIL PROTECTED] writes:

Lars == Lars Gullik Bjønnes [EMAIL PROTECTED] writes:

| Lars | May I kindly ask for the result of our discussion? | I
| Lars answered all of your questions and now I cannot see how to
| Lars proceed.
| Lars For 1.3. J-M is calling the shots.
| I propose to commit the QuoteName changes to 1.3.x and 1.4.0cvs, since
| they seem obvious enough. 

| Lars, OK?
ok
Thank you all.
Regarding the cvs edit subcommand:
I'm using readonly checkouts with the global option
-r (readonly), resp. an entry cvs -rq in my $HOME/.cvsrc.
So every file of my checkouts is readonly at the beginning.
If I want to edit it I have to be explicit and cannot do this
by accident. I can use a chmod or even better cvs edit.
So I added a mapping of function key F2 to $HOME/.exrc
and may turn the readonly checkout with a key press to an
writable one. Another benefit of using cvs edit is the
ability to tell if someone is working in parallel or has not
finished her modifications yet (cvs editors).
IMHO the mapping of CVS::checkOut to cvs edit makes sense
because of the logic of LFUN_VC_CHECKOUT too:
   case LFUN_VC_CHECKOUT:
   {
  if (owner-buffer()-lyxvc.inUse()// file is checked out already
   owner-buffer()-isReadonly()) // file is readonly
 owner-buffer()-lyxvc.checkOut();
   }
   break;
Maybe the terminus CHECKOUT is a bit misnamed here.
Stephan



Re: Patch for 1.3.X: vc-backend file quoting+CVS::checkOut

2005-03-21 Thread Jean-Marc Lasgouttes
> "Lars" == Lars Gullik Bjønnes <[EMAIL PROTECTED]> writes:

Lars> | May I kindly ask for the result of our discussion? | I
Lars> answered all of your questions and now I cannot see how to
Lars> proceed.

Lars> For 1.3. J-M is calling the shots.

I propose to commit the QuoteName changes to 1.3.x and 1.4.0cvs, since
they seem obvious enough. 

Lars, OK?

Lars> I think it is ok, but I am a bit worried about having checkout
Lars> == edit.

Lars> Also I am a bit afraid of different CVS usage pattersn. I .fex.
Lars> never use 'cvs edit' and always work in the 'shared' state. Will
Lars> this way or working have the potential of being confused with
Lars> checkouts and such.

We can keep this for later, then. I also use checkout and know nothing
about edit...

What does emacs do?

JMarc


Re: Patch for 1.3.X: vc-backend file quoting+CVS::checkOut

2005-03-21 Thread Lars Gullik Bjønnes
Jean-Marc Lasgouttes <[EMAIL PROTECTED]> writes:

>> "Lars" == Lars Gullik Bjønnes <[EMAIL PROTECTED]> writes:
>
| Lars> | May I kindly ask for the result of our discussion? | I
| Lars> answered all of your questions and now I cannot see how to
| Lars> proceed.
>
| Lars> For 1.3. J-M is calling the shots.
>
| I propose to commit the QuoteName changes to 1.3.x and 1.4.0cvs, since
| they seem obvious enough. 
>
| Lars, OK?

ok

-- 
Lgb



Re: Patch for 1.3.X: vc-backend file quoting+CVS::checkOut

2005-03-21 Thread Stephan Witt
Lars Gullik Bjønnes wrote:
Jean-Marc Lasgouttes <[EMAIL PROTECTED]> writes:

"Lars" == Lars Gullik Bjønnes <[EMAIL PROTECTED]> writes:

| Lars> | May I kindly ask for the result of our discussion? | I
| Lars> answered all of your questions and now I cannot see how to
| Lars> proceed.
| Lars> For 1.3. J-M is calling the shots.
| I propose to commit the QuoteName changes to 1.3.x and 1.4.0cvs, since
| they seem obvious enough. 

| Lars, OK?
ok
Thank you all.
Regarding the cvs edit subcommand:
I'm using readonly checkouts with the global option
-r (readonly), resp. an entry "cvs -rq" in my $HOME/.cvsrc.
So every file of my checkouts is readonly at the beginning.
If I want to edit it I have to be explicit and cannot do this
by accident. I can use a "chmod" or even better "cvs edit".
So I added a mapping of function key F2 to $HOME/.exrc
and may turn the readonly checkout with a key press to an
writable one. Another benefit of using "cvs edit" is the
ability to tell if someone is working in parallel or has not
finished her modifications yet ("cvs editors").
IMHO the mapping of CVS::checkOut to "cvs edit" makes sense
because of the logic of LFUN_VC_CHECKOUT too:
   case LFUN_VC_CHECKOUT:
   {
  if (owner->buffer()->lyxvc.inUse()// file is checked out already
  && owner->buffer()->isReadonly()) // file is readonly
 owner->buffer()->lyxvc.checkOut();
   }
   break;
Maybe the terminus "CHECKOUT" is a bit misnamed here.
Stephan



Re: Patch for 1.3.X: vc-backend file quoting+CVS::checkOut

2005-03-07 Thread Stephan Witt
Lars Gullik Bjønnes wrote:
[EMAIL PROTECTED] (Lars Gullik Bjønnes) writes:
| | Yes. If one has a filename like 'file$patch1.lyx' the vc-backend fails
| | to process this one. It makes a system call like 'cvs log file$patch1.lyx'
| | for example. The shell tries to expand the environment variable patch1 and
| | replaces this with nothing. So you get 'cvs log file.lyx' after all.
Note that I didn't just mean if it is possible to construct files that
gives problems, but also if you actually have problems and have
experienced them in real life.
May I kindly ask for the result of our discussion?
I answered all of your questions and now I cannot see how to proceed.
My original question was the wish to add the CVS checkOut functionality
to the code base of LyX. Of course it may be debateable if one should do
this for the 1.3.X branch. And it may be improved by a check of the
writeable state of the file checked out.
With kind regards,
Stephan



Re: Patch for 1.3.X: vc-backend file quoting+CVS::checkOut

2005-03-07 Thread Lars Gullik Bjønnes
Stephan Witt [EMAIL PROTECTED] writes:

| Lars Gullik Bjønnes wrote:
 [EMAIL PROTECTED] (Lars Gullik Bjønnes) writes:
 | | Yes. If one has a filename like 'file$patch1.lyx' the vc-backend
 fails
 | | to process this one. It makes a system call like 'cvs log 
 file$patch1.lyx'
 | | for example. The shell tries to expand the environment variable patch1 
 and
 | | replaces this with nothing. So you get 'cvs log file.lyx' after all.
 Note that I didn't just mean if it is possible to construct files
 that
 gives problems, but also if you actually have problems and have
 experienced them in real life.

| May I kindly ask for the result of our discussion?
| I answered all of your questions and now I cannot see how to proceed.

For 1.3. J-M is calling the shots.

| My original question was the wish to add the CVS checkOut functionality
| to the code base of LyX. Of course it may be debateable if one should do
| this for the 1.3.X branch. And it may be improved by a check of the
| writeable state of the file checked out.

| With kind regards,

I think it is ok, but I am a bit worried about having checkout ==
edit.

Also I am a bit afraid of different CVS usage pattersn. I .fex. never
use 'cvs edit' and always work in the 'shared' state. Will this way or
working have the potential of being confused with checkouts and such.

Basically I'd like more opinions.

-- 
Lgb



Re: Patch for 1.3.X: vc-backend file quoting+CVS::checkOut

2005-03-07 Thread Stephan Witt
Lars Gullik Bjønnes wrote:
[EMAIL PROTECTED] (Lars Gullik Bjønnes) writes:
| | Yes. If one has a filename like 'file$patch1.lyx' the vc-backend fails
| | to process this one. It makes a system call like 'cvs log "file$patch1.lyx"'
| | for example. The shell tries to expand the environment variable patch1 and
| | replaces this with nothing. So you get 'cvs log "file.lyx"' after all.
Note that I didn't just mean if it is possible to construct files that
gives problems, but also if you actually have problems and have
experienced them in real life.
May I kindly ask for the result of our discussion?
I answered all of your questions and now I cannot see how to proceed.
My original question was the wish to add the CVS checkOut functionality
to the code base of LyX. Of course it may be debateable if one should do
this for the 1.3.X branch. And it may be improved by a check of the
writeable state of the file checked out.
With kind regards,
Stephan



Re: Patch for 1.3.X: vc-backend file quoting+CVS::checkOut

2005-03-07 Thread Lars Gullik Bjønnes
Stephan Witt <[EMAIL PROTECTED]> writes:

| Lars Gullik Bjønnes wrote:
>> [EMAIL PROTECTED] (Lars Gullik Bjønnes) writes:
>> | | Yes. If one has a filename like 'file$patch1.lyx' the vc-backend
>> fails
>> | | to process this one. It makes a system call like 'cvs log 
>> "file$patch1.lyx"'
>> | | for example. The shell tries to expand the environment variable patch1 
>> and
>> | | replaces this with nothing. So you get 'cvs log "file.lyx"' after all.
>> Note that I didn't just mean if it is possible to construct files
>> that
>> gives problems, but also if you actually have problems and have
>> experienced them in real life.
>
| May I kindly ask for the result of our discussion?
| I answered all of your questions and now I cannot see how to proceed.

For 1.3. J-M is calling the shots.

| My original question was the wish to add the CVS checkOut functionality
| to the code base of LyX. Of course it may be debateable if one should do
| this for the 1.3.X branch. And it may be improved by a check of the
| writeable state of the file checked out.
>
| With kind regards,

I think it is ok, but I am a bit worried about having checkout ==
edit.

Also I am a bit afraid of different CVS usage pattersn. I .fex. never
use 'cvs edit' and always work in the 'shared' state. Will this way or
working have the potential of being confused with checkouts and such.

Basically I'd like more opinions.

-- 
Lgb



Re: Patch for 1.3.X: vc-backend file quoting+CVS::checkOut

2005-03-04 Thread Lars Gullik Bjønnes
Stephan Witt [EMAIL PROTECTED] writes:

| Dear LyX-Developers,

| recently I started to check BRANCH_1_3_X for productive work.
| I'm very pleased with the features and stability of it.

| We're using CVS at our site for managing revision control
| of our documents. So I had a look in src/vc-backend.C to
| see if I can make a working implementation of CVS::checkOut().

| The attached patch contains two things:
| 1) the mentioned functionality of CVS checkOut

I am not sure this is a good idea. Do you actually use cvs edit when
editing a file?

Why not cvs checkout btw?

And do you actually use it?

| 2) a change in filename quoting

Does this fix a problem?
Even in 1.4 I would be wary of changing this at this stage, unless it
fixes a real experienced problem.

| @@ -327,7 +326,10 @@ void CVS::checkIn(string const  msg)
|  void CVS::checkOut()
|  {
|   // cvs update or perhaps for cvs this should be a noop
| - lyxerr  Sorry not implemented.  endl;
| + doVCCommand(cvs -q edit 
| + + QuoteName(OnlyFilename(owner_-fileName())),
| + owner_-filePath());
| + reload();
|  }

-- 
Lgb



Re: Patch for 1.3.X: vc-backend file quoting+CVS::checkOut

2005-03-04 Thread Stephan Witt
Lars Gullik Bjønnes wrote:
Stephan Witt [EMAIL PROTECTED] writes:
| Dear LyX-Developers,
| recently I started to check BRANCH_1_3_X for productive work.
| I'm very pleased with the features and stability of it.
| We're using CVS at our site for managing revision control
| of our documents. So I had a look in src/vc-backend.C to
| see if I can make a working implementation of CVS::checkOut().
| The attached patch contains two things:
| 1) the mentioned functionality of CVS checkOut
I am not sure this is a good idea.
But, this is the only sensible operation for the menu item
Versionskontrolle = Zur Bearbeitung auschecken.
Perhaps the association of that menu item with CVS::checkOut()
is misleading. It should be renamed to CVS::edit() perhaps.
But that was not my primary goal.
Do you actually use cvs edit when
editing a file?
Yes.
Why not cvs checkout btw?
I cannot see how this should work. I want to make a writable copy of a file
inside a checkout I already did before.
We usually do a read-only checkout to be
1) sure not to modify a file by accident
2) be able to see who is editing a file with cvs editors
And how should I checkout a file with LyX?
The file is not present at this time. So it is not open and the
menu item Versionskontrolle is disabled.
And do you actually use it?
Yes.
| 2) a change in filename quoting
Does this fix a problem?
Yes. If one has a filename like 'file$patch1.lyx' the vc-backend fails
to process this one. It makes a system call like 'cvs log file$patch1.lyx'
for example. The shell tries to expand the environment variable patch1 and
replaces this with nothing. So you get 'cvs log file.lyx' after all.
The patched version uses QuoteName() and produces
cvs log 'file$patch1.lyx'
when the OS is Unix.
Even in 1.4 I would be wary of changing this at this stage, unless it
fixes a real experienced problem.
| @@ -327,7 +326,10 @@ void CVS::checkIn(string const  msg)
|  void CVS::checkOut()
|  {
|   // cvs update or perhaps for cvs this should be a noop
| - lyxerr  Sorry not implemented.  endl;
| + doVCCommand(cvs -q edit 
| + + QuoteName(OnlyFilename(owner_-fileName())),
| + owner_-filePath());
| + reload();
|  }
Regards,
Stephan



Re: Patch for 1.3.X: vc-backend file quoting+CVS::checkOut

2005-03-04 Thread Lars Gullik Bjønnes
Stephan Witt [EMAIL PROTECTED] writes:

| Lars Gullik Bjønnes wrote:
 Stephan Witt [EMAIL PROTECTED] writes:
 | Dear LyX-Developers,
 | recently I started to check BRANCH_1_3_X for productive work.
 | I'm very pleased with the features and stability of it.
 | We're using CVS at our site for managing revision control
 | of our documents. So I had a look in src/vc-backend.C to
 | see if I can make a working implementation of CVS::checkOut().
 | The attached patch contains two things:
 | 1) the mentioned functionality of CVS checkOut
 I am not sure this is a good idea.

| But, this is the only sensible operation for the menu item
| Versionskontrolle = Zur Bearbeitung auschecken.

| Perhaps the association of that menu item with CVS::checkOut()
| is misleading. It should be renamed to CVS::edit() perhaps.
| But that was not my primary goal.

Yeah... but now there exists an inconsistency between RCS and CVS.

Also we have take into account how others also use CVS. (not RO
checkouts)


 Do you actually use cvs edit when
 editing a file?

| Yes.

 Why not cvs checkout btw?

| I cannot see how this should work. I want to make a writable copy of a file
| inside a checkout I already did before.
| We usually do a read-only checkout to be
| 1) sure not to modify a file by accident
| 2) be able to see who is editing a file with cvs editors

| And how should I checkout a file with LyX?
| The file is not present at this time. So it is not open and the
| menu item Versionskontrolle is disabled.

 And do you actually use it?

| Yes.

Ok. 

 | 2) a change in filename quoting
 Does this fix a problem?

| Yes. If one has a filename like 'file$patch1.lyx' the vc-backend fails
| to process this one. It makes a system call like 'cvs log file$patch1.lyx'
| for example. The shell tries to expand the environment variable patch1 and
| replaces this with nothing. So you get 'cvs log file.lyx' after all.

And the rest of LyX has no problems with files with $ in them?
Note that the simple fix is to replace  quoting with '' quoting.
(I know this is what quotename does)

Not that I don't agree with the use of QuoteName, I only want to keep
the changes to a minimum and to the real cleanup in the development
version. And I wanted to make sure that it fixed a real problem.

 Even in 1.4 I would be wary of changing this at this stage, unless it
 fixes a real experienced problem.
 | @@ -327,7 +326,10 @@ void CVS::checkIn(string const  msg)
 |  void CVS::checkOut()
 |  {
 |// cvs update or perhaps for cvs this should be a noop
 | -  lyxerr  Sorry not implemented.  endl;
 | +  doVCCommand(cvs -q edit 
 | +  + QuoteName(OnlyFilename(owner_-fileName())),
 | +  owner_-filePath());
 | +  reload();
 |  }


| Regards,

| Stephan




-- 
Lgb



Re: Patch for 1.3.X: vc-backend file quoting+CVS::checkOut

2005-03-04 Thread Lars Gullik Bjønnes
[EMAIL PROTECTED] (Lars Gullik Bjønnes) writes:

| | Yes. If one has a filename like 'file$patch1.lyx' the vc-backend fails
| | to process this one. It makes a system call like 'cvs log file$patch1.lyx'
| | for example. The shell tries to expand the environment variable patch1 and
| | replaces this with nothing. So you get 'cvs log file.lyx' after all.

Note that I didn't just mean if it is possible to construct files that
gives problems, but also if you actually have problems and have
experienced them in real life.

-- 
Lgb


Re: Patch for 1.3.X: vc-backend file quoting+CVS::checkOut

2005-03-04 Thread Stephan Witt
Lars Gullik Bjønnes wrote:
[EMAIL PROTECTED] (Lars Gullik Bjønnes) writes:
| | Yes. If one has a filename like 'file$patch1.lyx' the vc-backend fails
| | to process this one. It makes a system call like 'cvs log file$patch1.lyx'
| | for example. The shell tries to expand the environment variable patch1 and
| | replaces this with nothing. So you get 'cvs log file.lyx' after all.
Note that I didn't just mean if it is possible to construct files that
gives problems, but also if you actually have problems and have
experienced them in real life.
Sorry, I cannot follow you. It is a real problem in the code.
And I would say, since QuoteName() came into existance it should be
used because it is save and it is OS-independant.
The question of the occurance in real live has to answered with yes or no.
Yes, I saw a filename with an dollar-sign in it created by ordinary users
already and no it was no lyx file. So, you may choose the answer yourself :)
The case of the dollar-signed file was placed in an CVS-Repository by
an innocent Windows-User and we had a funny time with it.
Regards,
Stephan



Re: Patch for 1.3.X: vc-backend file quoting+CVS::checkOut

2005-03-04 Thread Lars Gullik Bjønnes
Stephan Witt <[EMAIL PROTECTED]> writes:

| Dear LyX-Developers,
>
| recently I started to check BRANCH_1_3_X for productive work.
| I'm very pleased with the features and stability of it.
>
| We're using CVS at our site for managing revision control
| of our documents. So I had a look in src/vc-backend.C to
| see if I can make a working implementation of CVS::checkOut().
>
| The attached patch contains two things:
| 1) the mentioned functionality of CVS checkOut

I am not sure this is a good idea. Do you actually use "cvs edit" when
editing a file?

Why not "cvs checkout" btw?

And do you actually use it?

| 2) a change in filename quoting

Does this fix a problem?
Even in 1.4 I would be wary of changing this at this stage, unless it
fixes a real experienced problem.

| @@ -327,7 +326,10 @@ void CVS::checkIn(string const & msg)
|  void CVS::checkOut()
|  {
|   // cvs update or perhaps for cvs this should be a noop
| - lyxerr << "Sorry not implemented." << endl;
| + doVCCommand("cvs -q edit "
| + + QuoteName(OnlyFilename(owner_->fileName())),
| + owner_->filePath());
| + reload();
|  }

-- 
Lgb



Re: Patch for 1.3.X: vc-backend file quoting+CVS::checkOut

2005-03-04 Thread Stephan Witt
Lars Gullik Bjønnes wrote:
Stephan Witt <[EMAIL PROTECTED]> writes:
| Dear LyX-Developers,
| recently I started to check BRANCH_1_3_X for productive work.
| I'm very pleased with the features and stability of it.
| We're using CVS at our site for managing revision control
| of our documents. So I had a look in src/vc-backend.C to
| see if I can make a working implementation of CVS::checkOut().
| The attached patch contains two things:
| 1) the mentioned functionality of CVS checkOut
I am not sure this is a good idea.
But, this is the only sensible operation for the menu item
"Versionskontrolle => Zur Bearbeitung auschecken".
Perhaps the association of that menu item with CVS::checkOut()
is misleading. It should be renamed to CVS::edit() perhaps.
But that was not my primary goal.
Do you actually use "cvs edit" when
editing a file?
Yes.
Why not "cvs checkout" btw?
I cannot see how this should work. I want to make a writable copy of a file
inside a checkout I already did before.
We usually do a read-only checkout to be
1) sure not to modify a file by accident
2) be able to see who is editing a file with "cvs editors"
And how should I checkout a file with LyX?
The file is not present at this time. So it is not open and the
menu item "Versionskontrolle" is disabled.
And do you actually use it?
Yes.
| 2) a change in filename quoting
Does this fix a problem?
Yes. If one has a filename like 'file$patch1.lyx' the vc-backend fails
to process this one. It makes a system call like 'cvs log "file$patch1.lyx"'
for example. The shell tries to expand the environment variable patch1 and
replaces this with nothing. So you get 'cvs log "file.lyx"' after all.
The patched version uses QuoteName() and produces
cvs log 'file$patch1.lyx'
when the OS is Unix.
Even in 1.4 I would be wary of changing this at this stage, unless it
fixes a real experienced problem.
| @@ -327,7 +326,10 @@ void CVS::checkIn(string const & msg)
|  void CVS::checkOut()
|  {
|   // cvs update or perhaps for cvs this should be a noop
| - lyxerr << "Sorry not implemented." << endl;
| + doVCCommand("cvs -q edit "
| + + QuoteName(OnlyFilename(owner_->fileName())),
| + owner_->filePath());
| + reload();
|  }
Regards,
Stephan



Re: Patch for 1.3.X: vc-backend file quoting+CVS::checkOut

2005-03-04 Thread Lars Gullik Bjønnes
Stephan Witt <[EMAIL PROTECTED]> writes:

| Lars Gullik Bjønnes wrote:
>> Stephan Witt <[EMAIL PROTECTED]> writes:
>> | Dear LyX-Developers,
>> | recently I started to check BRANCH_1_3_X for productive work.
>> | I'm very pleased with the features and stability of it.
>> | We're using CVS at our site for managing revision control
>> | of our documents. So I had a look in src/vc-backend.C to
>> | see if I can make a working implementation of CVS::checkOut().
>> | The attached patch contains two things:
>> | 1) the mentioned functionality of CVS checkOut
>> I am not sure this is a good idea.
>
| But, this is the only sensible operation for the menu item
| "Versionskontrolle => Zur Bearbeitung auschecken".
>
| Perhaps the association of that menu item with CVS::checkOut()
| is misleading. It should be renamed to CVS::edit() perhaps.
| But that was not my primary goal.

Yeah... but now there exists an inconsistency between RCS and CVS.

Also we have take into account how others also use CVS. (not RO
checkouts)

>
>> Do you actually use "cvs edit" when
>> editing a file?
>
| Yes.
>
>> Why not "cvs checkout" btw?
>
| I cannot see how this should work. I want to make a writable copy of a file
| inside a checkout I already did before.
| We usually do a read-only checkout to be
| 1) sure not to modify a file by accident
| 2) be able to see who is editing a file with "cvs editors"
>
| And how should I checkout a file with LyX?
| The file is not present at this time. So it is not open and the
| menu item "Versionskontrolle" is disabled.
>
>> And do you actually use it?
>
| Yes.

Ok. 

>> | 2) a change in filename quoting
>> Does this fix a problem?
>
| Yes. If one has a filename like 'file$patch1.lyx' the vc-backend fails
| to process this one. It makes a system call like 'cvs log "file$patch1.lyx"'
| for example. The shell tries to expand the environment variable patch1 and
| replaces this with nothing. So you get 'cvs log "file.lyx"' after all.

And the rest of LyX has no problems with files with $ in them?
Note that the "simple" fix is to replace "" quoting with '' quoting.
(I know this is what quotename does)

Not that I don't agree with the use of QuoteName, I only want to keep
the changes to a minimum and to the real cleanup in the development
version. And I wanted to make sure that it fixed a real problem.

>> Even in 1.4 I would be wary of changing this at this stage, unless it
>> fixes a real experienced problem.
>> | @@ -327,7 +326,10 @@ void CVS::checkIn(string const & msg)
>> |  void CVS::checkOut()
>> |  {
>> |// cvs update or perhaps for cvs this should be a noop
>> | -  lyxerr << "Sorry not implemented." << endl;
>> | +  doVCCommand("cvs -q edit "
>> | +  + QuoteName(OnlyFilename(owner_->fileName())),
>> | +  owner_->filePath());
>> | +  reload();
>> |  }
>>
>
| Regards,
>
| Stephan
>
>
>

-- 
Lgb



Re: Patch for 1.3.X: vc-backend file quoting+CVS::checkOut

2005-03-04 Thread Lars Gullik Bjønnes
[EMAIL PROTECTED] (Lars Gullik Bjønnes) writes:

| | Yes. If one has a filename like 'file$patch1.lyx' the vc-backend fails
| | to process this one. It makes a system call like 'cvs log "file$patch1.lyx"'
| | for example. The shell tries to expand the environment variable patch1 and
| | replaces this with nothing. So you get 'cvs log "file.lyx"' after all.

Note that I didn't just mean if it is possible to construct files that
gives problems, but also if you actually have problems and have
experienced them in real life.

-- 
Lgb


Re: Patch for 1.3.X: vc-backend file quoting+CVS::checkOut

2005-03-04 Thread Stephan Witt
Lars Gullik Bjønnes wrote:
[EMAIL PROTECTED] (Lars Gullik Bjønnes) writes:
| | Yes. If one has a filename like 'file$patch1.lyx' the vc-backend fails
| | to process this one. It makes a system call like 'cvs log "file$patch1.lyx"'
| | for example. The shell tries to expand the environment variable patch1 and
| | replaces this with nothing. So you get 'cvs log "file.lyx"' after all.
Note that I didn't just mean if it is possible to construct files that
gives problems, but also if you actually have problems and have
experienced them in real life.
Sorry, I cannot follow you. It is a real problem in the code.
And I would say, since QuoteName() came into existance it should be
used because it is save and it is OS-independant.
The question of the occurance in real live has to answered with yes or no.
Yes, I saw a filename with an dollar-sign in it created by ordinary users
already and no it was no lyx file. So, you may choose the answer yourself :)
The case of the "dollar-signed" file was placed in an CVS-Repository by
an innocent Windows-User and we had a funny time with it.
Regards,
Stephan