Fossil SCM

Add "ci" as an alias for "commit". Make provisions for a future "fossil mv" command.

drh 2008-10-21 06:10 trunk
Commit 2bde9f9b3d97781ea981f8ac6a0c37b6771e9fae
--- src/checkin.c
+++ src/checkin.c
@@ -329,10 +329,11 @@
329329
g.aCommitFile[ii-2] = 0;
330330
}
331331
}
332332
333333
/*
334
+** COMMAND: ci
334335
** COMMAND: commit
335336
**
336337
** Usage: %fossil commit ?-m COMMENT? ?--nosign? ?FILE...?
337338
**
338339
** Create a new version containing all of the changes in the current
339340
--- src/checkin.c
+++ src/checkin.c
@@ -329,10 +329,11 @@
329 g.aCommitFile[ii-2] = 0;
330 }
331 }
332
333 /*
 
334 ** COMMAND: commit
335 **
336 ** Usage: %fossil commit ?-m COMMENT? ?--nosign? ?FILE...?
337 **
338 ** Create a new version containing all of the changes in the current
339
--- src/checkin.c
+++ src/checkin.c
@@ -329,10 +329,11 @@
329 g.aCommitFile[ii-2] = 0;
330 }
331 }
332
333 /*
334 ** COMMAND: ci
335 ** COMMAND: commit
336 **
337 ** Usage: %fossil commit ?-m COMMENT? ?--nosign? ?FILE...?
338 **
339 ** Create a new version containing all of the changes in the current
340
+12 -4
--- src/manifest.c
+++ src/manifest.c
@@ -141,11 +141,11 @@
141141
*/
142142
int manifest_parse(Manifest *p, Blob *pContent){
143143
int seenHeader = 0;
144144
int seenZ = 0;
145145
int i, lineNo=0;
146
- Blob line, token, a1, a2, a3;
146
+ Blob line, token, a1, a2, a3, a4;
147147
char cPrevType = 0;
148148
149149
memset(p, 0, sizeof(*p));
150150
memcpy(&p->content, pContent, sizeof(p->content));
151151
blob_zero(pContent);
@@ -272,18 +272,18 @@
272272
}
273273
break;
274274
}
275275
276276
/*
277
- ** F <filename> <uuid> ?<permissions>?
277
+ ** F <filename> <uuid> ?<permissions>? ?<old-name>?
278278
**
279279
** Identifies a file in a manifest. Multiple F lines are
280280
** allowed in a manifest. F lines are not allowed in any
281
- ** other control file. The filename is fossil-encoded.
281
+ ** other control file. The filename and old-name are fossil-encoded.
282282
*/
283283
case 'F': {
284
- char *zName, *zUuid, *zPerm;
284
+ char *zName, *zUuid, *zPerm, *zPriorName;
285285
md5sum_step_text(blob_buffer(&line), blob_size(&line));
286286
if( blob_token(&line, &a1)==0 ) goto manifest_syntax_error;
287287
if( blob_token(&line, &a2)==0 ) goto manifest_syntax_error;
288288
zName = blob_terminate(&a1);
289289
zUuid = blob_terminate(&a2);
@@ -292,10 +292,18 @@
292292
if( blob_size(&a2)!=UUID_SIZE ) goto manifest_syntax_error;
293293
if( !validate16(zUuid, UUID_SIZE) ) goto manifest_syntax_error;
294294
defossilize(zName);
295295
if( !file_is_simple_pathname(zName) ){
296296
goto manifest_syntax_error;
297
+ }
298
+ blob_token(&line, &a4);
299
+ zPriorName = blob_terminate(&a4);
300
+ if( zPriorName[0] ){
301
+ defossilize(zPriorName);
302
+ if( !file_is_simple_pathname(zPriorName) ){
303
+ goto manifest_syntax_error;
304
+ }
297305
}
298306
if( p->nFile>=p->nFileAlloc ){
299307
p->nFileAlloc = p->nFileAlloc*2 + 10;
300308
p->aFile = realloc(p->aFile, p->nFileAlloc*sizeof(p->aFile[0]) );
301309
if( p->aFile==0 ) fossil_panic("out of memory");
302310
--- src/manifest.c
+++ src/manifest.c
@@ -141,11 +141,11 @@
141 */
142 int manifest_parse(Manifest *p, Blob *pContent){
143 int seenHeader = 0;
144 int seenZ = 0;
145 int i, lineNo=0;
146 Blob line, token, a1, a2, a3;
147 char cPrevType = 0;
148
149 memset(p, 0, sizeof(*p));
150 memcpy(&p->content, pContent, sizeof(p->content));
151 blob_zero(pContent);
@@ -272,18 +272,18 @@
272 }
273 break;
274 }
275
276 /*
277 ** F <filename> <uuid> ?<permissions>?
278 **
279 ** Identifies a file in a manifest. Multiple F lines are
280 ** allowed in a manifest. F lines are not allowed in any
281 ** other control file. The filename is fossil-encoded.
282 */
283 case 'F': {
284 char *zName, *zUuid, *zPerm;
285 md5sum_step_text(blob_buffer(&line), blob_size(&line));
286 if( blob_token(&line, &a1)==0 ) goto manifest_syntax_error;
287 if( blob_token(&line, &a2)==0 ) goto manifest_syntax_error;
288 zName = blob_terminate(&a1);
289 zUuid = blob_terminate(&a2);
@@ -292,10 +292,18 @@
292 if( blob_size(&a2)!=UUID_SIZE ) goto manifest_syntax_error;
293 if( !validate16(zUuid, UUID_SIZE) ) goto manifest_syntax_error;
294 defossilize(zName);
295 if( !file_is_simple_pathname(zName) ){
296 goto manifest_syntax_error;
 
 
 
 
 
 
 
 
297 }
298 if( p->nFile>=p->nFileAlloc ){
299 p->nFileAlloc = p->nFileAlloc*2 + 10;
300 p->aFile = realloc(p->aFile, p->nFileAlloc*sizeof(p->aFile[0]) );
301 if( p->aFile==0 ) fossil_panic("out of memory");
302
--- src/manifest.c
+++ src/manifest.c
@@ -141,11 +141,11 @@
141 */
142 int manifest_parse(Manifest *p, Blob *pContent){
143 int seenHeader = 0;
144 int seenZ = 0;
145 int i, lineNo=0;
146 Blob line, token, a1, a2, a3, a4;
147 char cPrevType = 0;
148
149 memset(p, 0, sizeof(*p));
150 memcpy(&p->content, pContent, sizeof(p->content));
151 blob_zero(pContent);
@@ -272,18 +272,18 @@
272 }
273 break;
274 }
275
276 /*
277 ** F <filename> <uuid> ?<permissions>? ?<old-name>?
278 **
279 ** Identifies a file in a manifest. Multiple F lines are
280 ** allowed in a manifest. F lines are not allowed in any
281 ** other control file. The filename and old-name are fossil-encoded.
282 */
283 case 'F': {
284 char *zName, *zUuid, *zPerm, *zPriorName;
285 md5sum_step_text(blob_buffer(&line), blob_size(&line));
286 if( blob_token(&line, &a1)==0 ) goto manifest_syntax_error;
287 if( blob_token(&line, &a2)==0 ) goto manifest_syntax_error;
288 zName = blob_terminate(&a1);
289 zUuid = blob_terminate(&a2);
@@ -292,10 +292,18 @@
292 if( blob_size(&a2)!=UUID_SIZE ) goto manifest_syntax_error;
293 if( !validate16(zUuid, UUID_SIZE) ) goto manifest_syntax_error;
294 defossilize(zName);
295 if( !file_is_simple_pathname(zName) ){
296 goto manifest_syntax_error;
297 }
298 blob_token(&line, &a4);
299 zPriorName = blob_terminate(&a4);
300 if( zPriorName[0] ){
301 defossilize(zPriorName);
302 if( !file_is_simple_pathname(zPriorName) ){
303 goto manifest_syntax_error;
304 }
305 }
306 if( p->nFile>=p->nFileAlloc ){
307 p->nFileAlloc = p->nFileAlloc*2 + 10;
308 p->aFile = realloc(p->aFile, p->nFileAlloc*sizeof(p->aFile[0]) );
309 if( p->aFile==0 ) fossil_panic("out of memory");
310
--- www/fileformat.wiki
+++ www/fileformat.wiki
@@ -89,11 +89,11 @@
8989
</p>
9090
9191
<blockquote>
9292
<b>C</b> <i>checkin-comment</i><br>
9393
<b>D</b> <i>time-and-date-stamp</i><br>
94
-<b>F</b> <i>filename</i> <i>SHA1-hash</i><br>
94
+<b>F</b> <i>filename</i> <i>SHA1-hash</i> <i>permissions</i> <i>old-name</i><br>
9595
<b>P</b> <i>SHA1-hash</i>+<br>
9696
<b>R</b> <i>repository-checksum</i><br>
9797
<b>U</b> <i>user-login</i><br>
9898
<b>Z</b> <i>manifest-checksum</i>
9999
</blockquote>
@@ -123,19 +123,34 @@
123123
</blockquote>
124124
125125
<p>
126126
A manifest has zero or more F-cards. Each F-card defines a file
127127
(other than the manifest itself) which is part of the baseline that
128
-the manifest defines. There are two arguments. The first argment
128
+the manifest defines. There are two, three, or three arguments.
129
+The first argment
129130
is the pathname of the file in the baseline relative to the root
130131
of the project file hierarchy. No ".." or "." directories are allowed
131132
within the filename. Space characters are escaped as in C-card
132133
comment text. Backslash characters and newlines are not allowed
133134
within filenames. The directory separator character is a forward
134135
slash (ASCII 0x2F). The second argument to the F-card is the
135136
full 40-character lower-case hexadecimal SHA1 hash of the content
136
-artifact.
137
+artifact. The optional 3rd argument defines any special access
138
+permissions associated with the file. The only special code currently
139
+defined is "x" which means that the file is executable. All files are
140
+always readable and writable. This can be expressed by "w" permission
141
+if desired but is optional.
142
+The optional 4th argument is the name of the same file as it existed in
143
+the parent baseline. If the name of the file is unchanged from its
144
+parent, then the 4th argument is omitted.
145
+</p>
146
+
147
+<p>
148
+A manifest has zero or more N-cards. Each N card records a name changes
149
+to one of the files in the manifest. The first argument to the N code is
150
+the name of the file in the parent baseline. The second argument is the
151
+name of the file in the baseline defined by the manifest.
137152
</p>
138153
139154
<p>
140155
A manifest has zero or one P-cards. Most manifests have one P-card.
141156
The P-card has a varying number of arguments that
142157
--- www/fileformat.wiki
+++ www/fileformat.wiki
@@ -89,11 +89,11 @@
89 </p>
90
91 <blockquote>
92 <b>C</b> <i>checkin-comment</i><br>
93 <b>D</b> <i>time-and-date-stamp</i><br>
94 <b>F</b> <i>filename</i> <i>SHA1-hash</i><br>
95 <b>P</b> <i>SHA1-hash</i>+<br>
96 <b>R</b> <i>repository-checksum</i><br>
97 <b>U</b> <i>user-login</i><br>
98 <b>Z</b> <i>manifest-checksum</i>
99 </blockquote>
@@ -123,19 +123,34 @@
123 </blockquote>
124
125 <p>
126 A manifest has zero or more F-cards. Each F-card defines a file
127 (other than the manifest itself) which is part of the baseline that
128 the manifest defines. There are two arguments. The first argment
 
129 is the pathname of the file in the baseline relative to the root
130 of the project file hierarchy. No ".." or "." directories are allowed
131 within the filename. Space characters are escaped as in C-card
132 comment text. Backslash characters and newlines are not allowed
133 within filenames. The directory separator character is a forward
134 slash (ASCII 0x2F). The second argument to the F-card is the
135 full 40-character lower-case hexadecimal SHA1 hash of the content
136 artifact.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
137 </p>
138
139 <p>
140 A manifest has zero or one P-cards. Most manifests have one P-card.
141 The P-card has a varying number of arguments that
142
--- www/fileformat.wiki
+++ www/fileformat.wiki
@@ -89,11 +89,11 @@
89 </p>
90
91 <blockquote>
92 <b>C</b> <i>checkin-comment</i><br>
93 <b>D</b> <i>time-and-date-stamp</i><br>
94 <b>F</b> <i>filename</i> <i>SHA1-hash</i> <i>permissions</i> <i>old-name</i><br>
95 <b>P</b> <i>SHA1-hash</i>+<br>
96 <b>R</b> <i>repository-checksum</i><br>
97 <b>U</b> <i>user-login</i><br>
98 <b>Z</b> <i>manifest-checksum</i>
99 </blockquote>
@@ -123,19 +123,34 @@
123 </blockquote>
124
125 <p>
126 A manifest has zero or more F-cards. Each F-card defines a file
127 (other than the manifest itself) which is part of the baseline that
128 the manifest defines. There are two, three, or three arguments.
129 The first argment
130 is the pathname of the file in the baseline relative to the root
131 of the project file hierarchy. No ".." or "." directories are allowed
132 within the filename. Space characters are escaped as in C-card
133 comment text. Backslash characters and newlines are not allowed
134 within filenames. The directory separator character is a forward
135 slash (ASCII 0x2F). The second argument to the F-card is the
136 full 40-character lower-case hexadecimal SHA1 hash of the content
137 artifact. The optional 3rd argument defines any special access
138 permissions associated with the file. The only special code currently
139 defined is "x" which means that the file is executable. All files are
140 always readable and writable. This can be expressed by "w" permission
141 if desired but is optional.
142 The optional 4th argument is the name of the same file as it existed in
143 the parent baseline. If the name of the file is unchanged from its
144 parent, then the 4th argument is omitted.
145 </p>
146
147 <p>
148 A manifest has zero or more N-cards. Each N card records a name changes
149 to one of the files in the manifest. The first argument to the N code is
150 the name of the file in the parent baseline. The second argument is the
151 name of the file in the baseline defined by the manifest.
152 </p>
153
154 <p>
155 A manifest has zero or one P-cards. Most manifests have one P-card.
156 The P-card has a varying number of arguments that
157

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button