File: cvsgui-2.html

package info (click to toggle)
gcvs 1.0final-12
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 12,248 kB
  • ctags: 10,631
  • sloc: ansic: 71,709; cpp: 39,780; sh: 18,434; makefile: 1,915; yacc: 1,299; tcl: 1,283; perl: 910; lex: 249; csh: 185; lisp: 7
file content (178 lines) | stat: -rwxr-xr-x 8,538 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
<HTML>
<HEAD>
<TITLE>CvsGui : MacCVS and WinCvs: The MacCVS Client</TITLE>
</HEAD>
<BODY>
<A HREF="cvsgui-1.html"><IMG SRC="prev.gif" ALT="Previous"></A>
<A HREF="cvsgui-3.html"><IMG SRC="next.gif" ALT="Next"></A>
<A HREF="cvsgui.html#toc2"><IMG SRC="toc.gif" ALT="Contents"></A>
<HR>
<H2><A NAME="s2">2. The MacCVS Client</A></H2>

<H2><A NAME="ss2.1">2.1 Introduction</A></H2>


<P>The first port on Macintosh was made by 
<A HREF="mike@twinpeaks.prc.com">Mike Ladwig</A> using CodeWarrior 9, GUSI 1.7.2 and cvs 1.84. It allowed
to use MacCVS as a <B>console</B> program or as a <B>MacPerl</B> command.</P>
<P>A second port was made by 
<A HREF="neeri@iis.ee.ethz.ch">Matthias Neeracher</A>. He implemented cvs as a <B>MPW tool</B> and used
the cvs 1.9 distribution, dmake and CodeWarrior 9. This version works nicely but was never
included into the official release of cvs.</P>
<P>Both use the excellent Matthias Neeracher's 
<A HREF="http://www.iis.ee.ethz.ch/~neeri/">GUSI Library</A>
(for Grand Unified Sockets Library) which allows to port easily Unix code on Macintosh.</P>
<P>Despite of this ports, the cvs implementation for Macintosh is still
experimental and only the <B>client</B> side is available.</P>
<P>This current port uses <B>CodeWarrior Pro 3</B>, the <B>MSL</B> library, <B>cvs 1.10</B>,
<B>GUSI 1.8.4</B>, <B>Waste 1.3</B>, <B>TCL 8.1</B>
and optionnaly the 
<A HREF="ftp://ftp.cit.cornell.edu/pub/mac/kerberos/">KClient library</A>
(Kerberos authentication, a contribution of 
<A HREF="mailto:meeroh@MIT.EDU">Miro Jurisic</A>)</P>


<H2><A NAME="ss2.2">2.2 What is inside</A></H2>


<P>This is my second tentative to port CVS for Macintosh.</P>
<P>The first time I used the port of Mike Ladwig and added a little UI
to remember the CVSROOT and provide menu access.</P>
<P>Now using the Matthias Neeracher port, I've added again a little UI and
also enhanced or added some capabilities to the MacCVS client to :</P>
<P>
<UL>
<LI>deal with Macintosh files with a <B>resource fork</B> (using a HQX encoding or
a MacBinary encoding).</LI>
<LI>be <B>scriptable</B> by Apple Events.</LI>
<LI>allow to <B>import</B> initial modules directly from the macintosh (see the problems
relative to the 
<A HREF="#import">import</A> command).</LI>
<LI><B>control</B> when adding files : that's because many user make mistakes
when adding files and forget to add "as binary" when the file is binary.</LI>
<LI>use <B>Internet Config</B> to restore Mac signatures.</LI>
<LI>provide a work around for files which <B>auto-modify</B> each time you open it (such as
CW Pro 2 projects) : this behaviour is not compatible with CVS which checks for the
modification date on your disk. We refer to this kind of files as 
<A HREF="cvsgui-4.html#dirtyfiles">dirty files</A></LI>
<LI>rewrite the architecture of MacCVS so it uses cvs as a <B>shared library</B> (this
has several advantages I discuss in 
<A HREF="#hacking">Hacking CVS</A>).</LI>
</UL>
</P>
<P>For more informations, look at the 
<A HREF="#hacking">Hacking CVS</A> section.</P>


<H2><A NAME="textandbinary"></A> <A NAME="ss2.3">2.3 Binary and Text files</A></H2>


<P>For the macintosh cvs client :</P>
<P>
<UL>
<LI>a <B>plain binary</B> file is a file with a signature different of "TEXT" (for example
a Word document .doc) and no resource fork.</LI>
<LI>a <B>mac binary file</B> is a file with a signature different of "TEXT"
and a resource fork (for example a ResEdit file and most of the mac files).</LI>
<LI>a <B>text file</B> is a file with a signature of "TEXT".</LI>
</UL>
</P>
<P>MacCVS now supply some <B>controls when adding files</B> : that's because many user make mistakes
when adding files and forget to add "as binary" when the file is binary. It will warn
you if you are about to make a mistake.</P>
<P><B>Important</B> : You can force a binary file to be handled as <B>plain binary</B> when you
add or import files : that's because
sometimes you can accidentaly have a resource fork (like a <EM>CKID</EM> resource) onto
a plain binary file (for example on a CW project, a GIF file...). If you want to add files types
to be handled as plain binary, go to the preferences and add a new type.</P>
<P><B>Note</B> : The resource fork on a text file is <B>ignored</B>. If you want to keep the resource
fork of a text file, force to add the file as binary : but you won't be able to use this file on others platforms.</P>


<H2><A NAME="import"></A> <A NAME="ss2.4">2.4 The "import" problem</A></H2>


<P>The import command in cvs should be seen as inconsistent since it imports initially
all the files as text files (so it makes a line feed conversion between the client
and the server).</P>
<P>When the initial import is done and all the binary files have the binary attribute,
the server and the client agree to not convert this files and everything is working finely.</P>
<P>So the problem appears ONLY during the first import, and cvs user know that the
initial import is THE main difficulty with cvs.</P>
<P>Happy-fully, there are some turn-around :</P>
<P>
<UL>
<LI>Make the initial import directly from the cvs server machine
(for now on Unix or Windows platforms). But be careful with the line feeds
automatic translation when you copy files from and to !</LI>
<LI>Use the cvs <B>wrappers</B> file to mark extensions as binary. But you'll still not be
able to import from the client since all the files are initially transfered as text
to the server.</LI>
<LI>Use the <B>-W</B> option of cvs import : the problem is that you have to figure
yourself all the extensions to map to a binary format (the -W option works this way :
you can tell cvs that an extension, .gif for example, represents a set of binary file).
My experience shows you can make a lot of errors this way.</LI>
</UL>
</P>
<P>That's why the MacCVS port was implemented for :</P>
<P>
<UL>
<LI>Using the <B>import</B> command of the MacCVS client, you'll be able to have a
dialog which tells you the current binary mapping and let you modify it. It detects
also a lot of common errors and sometimes warn you about something you may care about.</LI>
<LI>When you hit continue, MacCVS will prepare automatically the line command
to cvs with the <B>binary wrappers</B> you want to use.</LI>
<LI>Finally you can import safely. Both the client and the server will know exactly
which files are binary and which one are text.</LI>
</UL>
</P>
<P><B>Very important note</B> : You still have to set the binary preferences in order to force MacCVS
to send the files as plain-binary to the server.</P>
<P><B>Very important note 2</B> : When you use plain binary files, be sure to have Internet Config
well-configured for these files : if not, you may loose your plain binary representation and won't
be able to open these files on others platforms (since they would be mac-encoded).</P>


<H2><A NAME="ss2.5">2.5 Getting started</A></H2>


<P>
<UL>
<LI>Be sure to be familiar with the 
<A HREF="#import">import</A> problem.</LI>
<LI>While you use CVS, make sure your Internet Config is always up-to-date
when using plain-binary files or if you set the Internet Config option for text.</LI>
<LI>Set in the preferences the <B>CVSROOT</B> and the kind of <B>authentication</B>.</LI>
<LI>If you create a <B>new module</B> using the import command, use first
carefully the report and fix all the errors or conflicts.</LI>
<LI>Use the <B>online-help</B> available on most of the menu entries or dialogs by activating
"Show ballons" in the help menu (unavailable on MacCVS 3.1).</LI>
</UL>
</P>


<H2><A NAME="hacking"></A> <A NAME="ss2.6">2.6 Hacking MacCvs</A></H2>


<P>The MacCvs port consists in :</P>
<P>
<UL>
<LI>A shared library with a MixedMode interface which contains the cvs code
and mimic the cvs command line. This architecture allows to re-initialize the
globals of cvs as well to separate really the implementation of the client and cvs.</LI>
<LI>An application which implements a UI, Apple Events, a console and call
the shared library to make the stuff.</LI>
</UL>
</P>
<P>What I've done after is to change a little bit client.c to oblige the client
to convert the file whenever it sends it to the server. This allows to encode/decode
the files in HQX format and also the disable/enable the line feed conversion when the
file is flat (no resource fork) and is not a text file.</P>


<HR>
<A HREF="cvsgui-1.html"><IMG SRC="prev.gif" ALT="Previous"></A>
<A HREF="cvsgui-3.html"><IMG SRC="next.gif" ALT="Next"></A>
<A HREF="cvsgui.html#toc2"><IMG SRC="toc.gif" ALT="Contents"></A>
</BODY>
</HTML>