Discussion:
CVS is mangling some text files
Harvey
2010-12-04 20:54:33 UTC
Permalink
I just went to some lengths to import and update some code of mine into
CVS. This is on a Windows Vista machine. CVS client 1.12.12 (client),
1.12.13 (Ubuntu server).

There are about 90 files in the project. When I checkout the project
files, there are 4 files that are mangled and I can't seem to get them
unmangled:

xxx/res/MFCPCons.ico
xxx/res/MFCPCons.rc2
xxx/resource.h
xxx/MFCPCons.rc

The .ico file is binary and correctly set up to be stored as binary in
the repository. The other 3 are text. If I fix up the mangling and
commit the files back to CVS, update leaves them alone but a checkout
into a fresh directory gives the garbage stuff again.

The mangling appears as "Asian" characters on every second line of the
text files. For example, the file resource.h should be:


//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by MFCPCons.rc
//
#define IDM_ABOUTBOX 0x0010
#define IDD_ABOUTBOX 100
#define IDS_ABOUTBOX 101
#define IDD_MFCPCONS_DIALOG 102
#define IDR_MAINFRAME 128
...


and what it appears as is:


//{{NO_DEPENDENCIES}}
??????????????????????????????????????????????????
// Used by MFCPCons.rc
?????
#define IDM_ABOUTBOX 0x0010
??????????????????????????????????????????????
#define IDS_ABOUTBOX 101
??????????????????????????????????????????????
#define IDR_MAINFRAME 128
...


Any ideas? I still have the original files and can recreate from them
if necessary.
--
Harvey
Harvey
2010-12-06 02:56:20 UTC
Permalink
Howdy - No responses seen for a day or so - please drop the issue in
gnu.cvs.help. I will reload and submit on gnu.cvs.bug.
Post by Harvey
I just went to some lengths to import and update some code of mine into
CVS. This is on a Windows Vista machine. CVS client 1.12.12 (client),
1.12.13 (Ubuntu server).
There are about 90 files in the project. When I checkout the project
files, there are 4 files that are mangled and I can't seem to get them
xxx/res/MFCPCons.ico
xxx/res/MFCPCons.rc2
xxx/resource.h
xxx/MFCPCons.rc
The .ico file is binary and correctly set up to be stored as binary in
the repository. The other 3 are text. If I fix up the mangling and
commit the files back to CVS, update leaves them alone but a checkout
into a fresh directory gives the garbage stuff again.
The mangling appears as "Asian" characters on every second line of the
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by MFCPCons.rc
//
#define IDM_ABOUTBOX 0x0010
#define IDD_ABOUTBOX 100
#define IDS_ABOUTBOX 101
#define IDD_MFCPCONS_DIALOG 102
#define IDR_MAINFRAME 128
...
//{{NO_DEPENDENCIES}}
??????????????????????????????????????????????????
// Used by MFCPCons.rc
?????
#define IDM_ABOUTBOX 0x0010
??????????????????????????????????????????????
#define IDS_ABOUTBOX 101
??????????????????????????????????????????????
#define IDR_MAINFRAME 128
...
Any ideas? I still have the original files and can recreate from them if
necessary.
--
Harvey
Larry Jones
2010-12-06 05:43:29 UTC
Permalink
Post by Harvey
I just went to some lengths to import and update some code of mine into
CVS. This is on a Windows Vista machine. CVS client 1.12.12 (client),
1.12.13 (Ubuntu server).
On Windows, it's critically important to distinguish between text and
binary when creating a file, either by adding it or importing it.
Post by Harvey
There are about 90 files in the project. When I checkout the project
files, there are 4 files that are mangled and I can't seem to get them
xxx/res/MFCPCons.ico
xxx/res/MFCPCons.rc2
xxx/resource.h
xxx/MFCPCons.rc
The .ico file is binary and correctly set up to be stored as binary in
the repository.
Make sure it's really set in the repository and not just in your working
directory. cvs log will show you the repository setting (keyword
substitution), cvs status will show you your working directory setting.
The best thing to do is to use cvs admin to set the repository file
correctly and then do cvs up -A to synchronize the working file.
Post by Harvey
The other 3 are text.
Windows has some strange ideas about what "text" means. Those files are
likely Unicode encoded rather than ASCII -- Windows may consider that
text, but it's binary as far as CVS is concerned. One way to find out
is to open the file in Notepad and then do File -> Save As: there's an
Encoding field that will tell you how the file is encoded. Saving the
files as ASCII and then committing them should fix the problem.

You might want to consider using WinCVS as your client -- it does a very
good job of automatically detecting text vs. binary so you can fix up
the files as needed before committing them rather than trying to clean
up afterwards.
--
Larry Jones

This sounds suspiciously like one of Dad's plots to build my character.
-- Calvin
Harvey
2010-12-09 04:28:30 UTC
Permalink
Thanks for the info.

Loading...