bug-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problem with cvs on windows.


From: eh
Subject: Problem with cvs on windows.
Date: Thu, 03 Jan 2002 12:51:03 +0000

Hi.

I am new to cvs and wanted to use it between a
winnt 4.0 and Digital Unix platform.

So I built cvs for 1.11 on the DU4 and Winnt
with no problems. When I started to use it I 
discovered that the windows version kept
destroying binary files.


Looking into it I discovered that the windows
version of cvs was opeing files in text mode
so adding <cr><lf> to all the <lf>'s it found.
Bugger!!

I rebuilt it adding the object file binmode.obj
to the build which causes windows to work in
binary mode so it leaves the <lf>'s alone.

This had a knockon effect such that the when 
notepad is opened to edit the file it looks a mess.
So I fixed that as well.

The binary checkin and out now works on both the
digital unix platform and the windows platform.

I have added to the bottom of this email a patch
that will make some small changes to cvs to make
the above work.

If this is the wrong thing to do then let me know
the right thing.

There is a slight compatability problem. cvs 
repositories built with the old windows code has
stray <cr>'s everyware.


Have fun.

Eamon.

-----------

Files changed and why.

cvsnt.dsp
This had binmode.obj added to both the release and
the debug dependancy. This causes msdos not to do
<lf> -> to <lf><cr> conversion.

src/cvs.h

This created a new macro EDITOR_FOPEN_STRING
that is used in logmsg.c when the editor
is opened. It is defined as "w+" which means
that the code is identical on all non windowsa
platforms.

src/logmsg.c

This had the string "w+" replaced by the
above macro EDITOR_FOPEN_STRING in the fopen
call.

windows-NT/options.h

This defined the EDITOR_FOPEN_STRING macro
for notepad as "w+t" causing notepad to open
in text mode and look as expected. Note that
the log message will have extra <cr>'s on the
end, however you are in windows land and
should expect that.


------------------


diff -c -r cvs-1.11/cvsnt.dsp cvs/cvsnt.dsp
*** cvs-1.11/cvsnt.dsp  Mon Apr 26 22:05:12 1999
--- cvs/cvsnt.dsp       Thu Jan  3 11:34:28 2002
***************
*** 49,55 ****
  # ADD BSC32 /nologo
  LINK32=link.exe
  # ADD BASE LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib 
comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib 
zlib\Release\zlib.lib diff\Release\libdiff.lib /nologo /subsystem:console 
/machine:I386 /out:".\Release\cvs.exe"
! # ADD LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib 
comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib 
zlib\Release\zlib.lib diff\Release\libdiff.lib /nologo /subsystem:console 
/machine:I386 /out:".\Release\cvs.exe"
  
  !ELSEIF  "$(CFG)" == "cvsnt - Win32 Debug"
  
--- 49,55 ----
  # ADD BSC32 /nologo
  LINK32=link.exe
  # ADD BASE LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib 
comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib 
zlib\Release\zlib.lib diff\Release\libdiff.lib /nologo /subsystem:console 
/machine:I386 /out:".\Release\cvs.exe"
! # ADD LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib 
comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib 
binmode.obj zlib\Release\zlib.lib diff\Release\libdiff.lib /nologo 
/subsystem:console /machine:I386 /out:".\Release\cvs.exe"
  
  !ELSEIF  "$(CFG)" == "cvsnt - Win32 Debug"
  
***************
*** 73,79 ****
  # ADD BSC32 /nologo
  LINK32=link.exe
  # ADD BASE LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib 
comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib 
zlib\Debug\zlib.lib diff\Debug\libdiff.lib /nologo /subsystem:console 
/pdb:".\Debug\cvs.pdb" /debug /machine:I386 /out:".\Debug\cvs.exe"
! # ADD LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib 
comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib 
zlib\Debug\zlib.lib diff\Debug\libdiff.lib /nologo /subsystem:console 
/pdb:".\Debug\cvs.pdb" /debug /machine:I386 /out:".\Debug\cvs.exe"
  # SUBTRACT BASE LINK32 /pdb:none
  # SUBTRACT LINK32 /pdb:none
  
--- 73,79 ----
  # ADD BSC32 /nologo
  LINK32=link.exe
  # ADD BASE LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib 
comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib 
zlib\Debug\zlib.lib diff\Debug\libdiff.lib /nologo /subsystem:console 
/pdb:".\Debug\cvs.pdb" /debug /machine:I386 /out:".\Debug\cvs.exe"
! # ADD LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib 
comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib 
binmode.obj zlib\Debug\zlib.lib diff\Debug\libdiff.lib /nologo 
/subsystem:console /pdb:".\Debug\cvs.pdb" /debug /machine:I386 
/out:".\Debug\cvs.exe"
  # SUBTRACT BASE LINK32 /pdb:none
  # SUBTRACT LINK32 /pdb:none
  
diff -c -r cvs-1.11/src/cvs.h cvs/src/cvs.h
*** cvs-1.11/src/cvs.h  Sat Jul  8 20:57:21 2000
--- cvs/src/cvs.h       Thu Jan  3 11:36:25 2002
***************
*** 263,268 ****
--- 263,278 ----
  #define       EDITOR2_ENV     "VISUAL"        /* which editor to use */
  #define       EDITOR3_ENV     "EDITOR"        /* which editor to use */
  /* #define    EDITOR_DFLT                Set by options.h */
+ /*
+  * There is a problem (Only one?) with Windows, so that
+  * if the notepad editor is used you have to tell windows
+  * to open it in text mode. So rather than put an ifdef
+  * in the code I have defined a new macro that contains
+  * the string to open the temp file for editor.
+  */
+ #ifndef EDITOR_FOPEN_STRING
+ #define EDITOR_FOPEN_STRING "w+"      /*      In win32 with notepad this is 
"w+t". */
+ #endif
  
  #define       CVSROOT_ENV     "CVSROOT"       /* source directory root */
  #define       CVSROOT_DFLT    NULL            /* No dflt; must set for 
checkout */
diff -c -r cvs-1.11/src/logmsg.c cvs/src/logmsg.c
*** cvs-1.11/src/logmsg.c       Wed Mar  1 16:33:39 2000
--- cvs/src/logmsg.c    Thu Jan  3 11:41:10 2002
***************
*** 194,200 ****
      /* Create a temporary file */
      fname = cvs_temp_name ();
    again:
!     if ((fp = CVS_FOPEN (fname, "w+")) == NULL)
        error (1, 0, "cannot create temporary file %s", fname);
  
      if (*messagep)
--- 194,200 ----
      /* Create a temporary file */
      fname = cvs_temp_name ();
    again:
!     if ((fp = CVS_FOPEN (fname, EDITOR_FOPEN_STRING)) == NULL)
        error (1, 0, "cannot create temporary file %s", fname);
  
      if (*messagep)
diff -c -r cvs-1.11/windows-NT/options.h cvs/windows-NT/options.h
*** cvs-1.11/windows-NT/options.h       Sat Feb 27 02:34:53 1999
--- cvs/windows-NT/options.h    Thu Jan  3 11:44:18 2002
***************
*** 50,58 ****
--- 50,64 ----
   * is reasonable).
   *
   * The notepad program seems to be Windows NT's bare-bones text editor.
+  * If you have compiled cvs with the binmode.obj file to make it
+  * compatable with binary files, then when you open the editor 'notpad' it
+  * looks bad. So we force the tempfile to be opened in text mode.
   */
  #ifndef EDITOR_DFLT
  #define       EDITOR_DFLT     "notepad"
+ #   ifndef EDITOR_FOPEN_STRING
+ #   define  EDITOR_FOPEN_STRING "w+t"
+ #   endif
  #endif
  
  /*

--------
Eamon.
Work: eamon@sonyoxford.co.uk
Home: eamon@eamons.com
www: http://www.eamons.com

Main's Law:
        For every action there is an equal and opposite government
program.

#include <standard_disclaimer.h>
Extra Disclaimer: Any resemblance between the above views and those
of my employer, my terminal, or the view out my window are purely
coincidental.  Any resemblance between the above and my own views is
non-deterministic.  The question of the existence of views in the
absence of anyone to hold them is left as an exercise for the reader.
The question of the existence of the reader is left as an exercise
for the second god coefficient.  (A discussion of non-orthogonal,
non-integral polytheism is beyond the scope of this article.)

!!!!!That's all folks!!!!!
Please note that anything after this sentence,
was added after this mail left Eamon.
http://www.sonyoxford.co.uk
http://www.sonyplugins.com



reply via email to

[Prev in Thread] Current Thread [Next in Thread]