Fossil SCM

Extend the file format for manifests to include the Q-card for recording cherry-picks. Parse and ignore these cards for now.

drh 2011-02-26 15:32 trunk
Commit 7fcbbb1da0dd28bf2d889ed6046c53cccda47836
--- src/manifest.c
+++ src/manifest.c
@@ -74,10 +74,15 @@
7474
int iFile; /* Index of current file in iterator */
7575
ManifestFile *aFile; /* One entry for each F-card */
7676
int nParent; /* Number of parents. */
7777
int nParentAlloc; /* Slots allocated in azParent[] */
7878
char **azParent; /* UUIDs of parents. One for each P card argument */
79
+ int nCherrypick; /* Number of entries in aCherrypick[] */
80
+ struct {
81
+ char *zCPTarget; /* UUID of cherry-picked version w/ +|- prefix */
82
+ char *zCPBase; /* UUID of cherry-pick baseline. NULL for singletons */
83
+ } *aCherrypick;
7984
int nCChild; /* Number of cluster children */
8085
int nCChildAlloc; /* Number of closts allocated in azCChild[] */
8186
char **azCChild; /* UUIDs of referenced objects in a cluster. M cards */
8287
int nTag; /* Number of T Cards */
8388
int nTagAlloc; /* Slots allocated in aTag[] */
@@ -121,10 +126,11 @@
121126
free(p->aFile);
122127
free(p->azParent);
123128
free(p->azCChild);
124129
free(p->aTag);
125130
free(p->aField);
131
+ free(p->aCherrypick);
126132
if( p->pBaseline ) manifest_destroy(p->pBaseline);
127133
memset(p, 0, sizeof(*p));
128134
fossil_free(p);
129135
}
130136
}
@@ -624,10 +630,34 @@
624630
i = p->nParent++;
625631
p->azParent[i] = zUuid;
626632
}
627633
break;
628634
}
635
+
636
+ /*
637
+ ** Q (+|-)<uuid> ?<uuid>?
638
+ **
639
+ ** Specify one or a range of checkins that are cherrypicked into
640
+ ** this checkin ("+") or backed out of this checkin ("-").
641
+ */
642
+ case 'Q': {
643
+ if( (zUuid = next_token(&x, &sz))==0 ) goto manifest_syntax_error;
644
+ if( sz!=UUID_SIZE+1 ) goto manifest_syntax_error;
645
+ if( zUuid[0]!='+' && zUuid[0]!='-' ) goto manifest_syntax_error;
646
+ if( !validate16(&zUuid[1], UUID_SIZE) ) goto manifest_syntax_error;
647
+ n = p->nCherrypick;
648
+ p->nCherrypick++;
649
+ p->aCherrypick = fossil_realloc(p->aCherrypick,
650
+ p->nCherrypick*sizeof(p->aCherrypick[0]));
651
+ p->aCherrypick[n].zCPTarget = zUuid;
652
+ p->aCherrypick[n].zCPBase = zUuid = next_token(&x, &sz);
653
+ if( zUuid ){
654
+ if( sz!=UUID_SIZE ) goto manifest_syntax_error;
655
+ if( !validate16(zUuid, UUID_SIZE) ) goto manifest_syntax_error;
656
+ }
657
+ break;
658
+ }
629659
630660
/*
631661
** R <md5sum>
632662
**
633663
** Specify the MD5 checksum over the name and content of all files
634664
--- src/manifest.c
+++ src/manifest.c
@@ -74,10 +74,15 @@
74 int iFile; /* Index of current file in iterator */
75 ManifestFile *aFile; /* One entry for each F-card */
76 int nParent; /* Number of parents. */
77 int nParentAlloc; /* Slots allocated in azParent[] */
78 char **azParent; /* UUIDs of parents. One for each P card argument */
 
 
 
 
 
79 int nCChild; /* Number of cluster children */
80 int nCChildAlloc; /* Number of closts allocated in azCChild[] */
81 char **azCChild; /* UUIDs of referenced objects in a cluster. M cards */
82 int nTag; /* Number of T Cards */
83 int nTagAlloc; /* Slots allocated in aTag[] */
@@ -121,10 +126,11 @@
121 free(p->aFile);
122 free(p->azParent);
123 free(p->azCChild);
124 free(p->aTag);
125 free(p->aField);
 
126 if( p->pBaseline ) manifest_destroy(p->pBaseline);
127 memset(p, 0, sizeof(*p));
128 fossil_free(p);
129 }
130 }
@@ -624,10 +630,34 @@
624 i = p->nParent++;
625 p->azParent[i] = zUuid;
626 }
627 break;
628 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
629
630 /*
631 ** R <md5sum>
632 **
633 ** Specify the MD5 checksum over the name and content of all files
634
--- src/manifest.c
+++ src/manifest.c
@@ -74,10 +74,15 @@
74 int iFile; /* Index of current file in iterator */
75 ManifestFile *aFile; /* One entry for each F-card */
76 int nParent; /* Number of parents. */
77 int nParentAlloc; /* Slots allocated in azParent[] */
78 char **azParent; /* UUIDs of parents. One for each P card argument */
79 int nCherrypick; /* Number of entries in aCherrypick[] */
80 struct {
81 char *zCPTarget; /* UUID of cherry-picked version w/ +|- prefix */
82 char *zCPBase; /* UUID of cherry-pick baseline. NULL for singletons */
83 } *aCherrypick;
84 int nCChild; /* Number of cluster children */
85 int nCChildAlloc; /* Number of closts allocated in azCChild[] */
86 char **azCChild; /* UUIDs of referenced objects in a cluster. M cards */
87 int nTag; /* Number of T Cards */
88 int nTagAlloc; /* Slots allocated in aTag[] */
@@ -121,10 +126,11 @@
126 free(p->aFile);
127 free(p->azParent);
128 free(p->azCChild);
129 free(p->aTag);
130 free(p->aField);
131 free(p->aCherrypick);
132 if( p->pBaseline ) manifest_destroy(p->pBaseline);
133 memset(p, 0, sizeof(*p));
134 fossil_free(p);
135 }
136 }
@@ -624,10 +630,34 @@
630 i = p->nParent++;
631 p->azParent[i] = zUuid;
632 }
633 break;
634 }
635
636 /*
637 ** Q (+|-)<uuid> ?<uuid>?
638 **
639 ** Specify one or a range of checkins that are cherrypicked into
640 ** this checkin ("+") or backed out of this checkin ("-").
641 */
642 case 'Q': {
643 if( (zUuid = next_token(&x, &sz))==0 ) goto manifest_syntax_error;
644 if( sz!=UUID_SIZE+1 ) goto manifest_syntax_error;
645 if( zUuid[0]!='+' && zUuid[0]!='-' ) goto manifest_syntax_error;
646 if( !validate16(&zUuid[1], UUID_SIZE) ) goto manifest_syntax_error;
647 n = p->nCherrypick;
648 p->nCherrypick++;
649 p->aCherrypick = fossil_realloc(p->aCherrypick,
650 p->nCherrypick*sizeof(p->aCherrypick[0]));
651 p->aCherrypick[n].zCPTarget = zUuid;
652 p->aCherrypick[n].zCPBase = zUuid = next_token(&x, &sz);
653 if( zUuid ){
654 if( sz!=UUID_SIZE ) goto manifest_syntax_error;
655 if( !validate16(zUuid, UUID_SIZE) ) goto manifest_syntax_error;
656 }
657 break;
658 }
659
660 /*
661 ** R <md5sum>
662 **
663 ** Specify the MD5 checksum over the name and content of all files
664
--- www/fileformat.wiki
+++ www/fileformat.wiki
@@ -100,10 +100,11 @@
100100
<b>B</b> <i>baseline-manifest</i><br>
101101
<b>C</b> <i>checkin-comment</i><br>
102102
<b>D</b> <i>time-and-date-stamp</i><br>
103103
<b>F</b> <i>filename</i> <i>SHA1-hash</i> <i>permissions</i> <i>old-name</i><br>
104104
<b>P</b> <i>SHA1-hash</i>+<br>
105
+<b>Q</b> (<b>+</b>|<b>-</b>)<i>SHA1-hash ?SHA1-hash?</i><br>
105106
<b>R</b> <i>repository-checksum</i><br>
106107
<b>T</b> (<b>+</b>|<b>-</b>|<b>*</b>)<i>tag-name <b>*</b> ?value?</i><br>
107108
<b>U</b> <i>user-login</i><br>
108109
<b>Z</b> <i>manifest-checksum</i>
109110
</blockquote>
@@ -169,10 +170,29 @@
169170
The first predecessor is the direct ancestor of the manifest.
170171
Other arguments define manifests with which the first was
171172
merged to yield the current manifest. Most manifests have
172173
a P-card with a single argument. The first manifest in the
173174
project has no ancestors and thus has no P-card.
175
+
176
+A manifest has zero or more Q-cards. A Q-card is similar to a P-card
177
+in that it defines a predecessor to the current check-in. But
178
+whereas a P-card defines the immediate ancestor or a merge
179
+ancestor, the Q-card is used to identify a single check-in or a small
180
+range of check-ins which were cherry-picked for inclusion in or
181
+exclusion from the the current manifest. The first argument of
182
+the Q-card is the artifact ID of another manifest (the "target")
183
+which has had its changes included or excluded in the current manifest.
184
+The target is preceeded by "+" or "-" to show inclusion or
185
+exclusion, respectively. The optional second argument to the
186
+Q-card is another manifest artifact ID which is the "baseline"
187
+for the cherry-pick. If omitted, the baseline is the primary
188
+parent of the target. The
189
+changes included or excluded consist of all changes moving from
190
+the baseline to the target.
191
+
192
+The Q-card was added to the interface specification on 2011-02-26.
193
+Older versions of Fossil will reject manifests that contain Q-cards.
174194
175195
A manifest may optionally have a single R-card. The R-card has
176196
a single argument which is the MD5 checksum of all files in
177197
the check-in except the manifest itself. The checksum is expressed
178198
as 32-characters of lowercase hexadecimal. The checksum is
@@ -614,10 +634,20 @@
614634
<td><b>P</b> <i>uuid ...</i></td>
615635
<td align=center><b>X</b></td>
616636
<td align=center>&nbsp;</td>
617637
<td align=center>&nbsp;</td>
618638
<td align=center><b>X</b></td>
639
+<td align=center>&nbsp;</td>
640
+<td align=center>&nbsp;</td>
641
+<td align=center>&nbsp;</td>
642
+</tr>
643
+<tr>
644
+<td><b>Q</b> (<b>+</b>|<b>-</b>)<i>uuid uuid</i></td>
645
+<td align=center><b>X</b></td>
646
+<td align=center>&nbsp;</td>
647
+<td align=center>&nbsp;</td>
648
+<td align=center>&nbsp;</td>
619649
<td align=center>&nbsp;</td>
620650
<td align=center>&nbsp;</td>
621651
<td align=center>&nbsp;</td>
622652
</tr>
623653
<tr>
624654
--- www/fileformat.wiki
+++ www/fileformat.wiki
@@ -100,10 +100,11 @@
100 <b>B</b> <i>baseline-manifest</i><br>
101 <b>C</b> <i>checkin-comment</i><br>
102 <b>D</b> <i>time-and-date-stamp</i><br>
103 <b>F</b> <i>filename</i> <i>SHA1-hash</i> <i>permissions</i> <i>old-name</i><br>
104 <b>P</b> <i>SHA1-hash</i>+<br>
 
105 <b>R</b> <i>repository-checksum</i><br>
106 <b>T</b> (<b>+</b>|<b>-</b>|<b>*</b>)<i>tag-name <b>*</b> ?value?</i><br>
107 <b>U</b> <i>user-login</i><br>
108 <b>Z</b> <i>manifest-checksum</i>
109 </blockquote>
@@ -169,10 +170,29 @@
169 The first predecessor is the direct ancestor of the manifest.
170 Other arguments define manifests with which the first was
171 merged to yield the current manifest. Most manifests have
172 a P-card with a single argument. The first manifest in the
173 project has no ancestors and thus has no P-card.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
174
175 A manifest may optionally have a single R-card. The R-card has
176 a single argument which is the MD5 checksum of all files in
177 the check-in except the manifest itself. The checksum is expressed
178 as 32-characters of lowercase hexadecimal. The checksum is
@@ -614,10 +634,20 @@
614 <td><b>P</b> <i>uuid ...</i></td>
615 <td align=center><b>X</b></td>
616 <td align=center>&nbsp;</td>
617 <td align=center>&nbsp;</td>
618 <td align=center><b>X</b></td>
 
 
 
 
 
 
 
 
 
 
619 <td align=center>&nbsp;</td>
620 <td align=center>&nbsp;</td>
621 <td align=center>&nbsp;</td>
622 </tr>
623 <tr>
624
--- www/fileformat.wiki
+++ www/fileformat.wiki
@@ -100,10 +100,11 @@
100 <b>B</b> <i>baseline-manifest</i><br>
101 <b>C</b> <i>checkin-comment</i><br>
102 <b>D</b> <i>time-and-date-stamp</i><br>
103 <b>F</b> <i>filename</i> <i>SHA1-hash</i> <i>permissions</i> <i>old-name</i><br>
104 <b>P</b> <i>SHA1-hash</i>+<br>
105 <b>Q</b> (<b>+</b>|<b>-</b>)<i>SHA1-hash ?SHA1-hash?</i><br>
106 <b>R</b> <i>repository-checksum</i><br>
107 <b>T</b> (<b>+</b>|<b>-</b>|<b>*</b>)<i>tag-name <b>*</b> ?value?</i><br>
108 <b>U</b> <i>user-login</i><br>
109 <b>Z</b> <i>manifest-checksum</i>
110 </blockquote>
@@ -169,10 +170,29 @@
170 The first predecessor is the direct ancestor of the manifest.
171 Other arguments define manifests with which the first was
172 merged to yield the current manifest. Most manifests have
173 a P-card with a single argument. The first manifest in the
174 project has no ancestors and thus has no P-card.
175
176 A manifest has zero or more Q-cards. A Q-card is similar to a P-card
177 in that it defines a predecessor to the current check-in. But
178 whereas a P-card defines the immediate ancestor or a merge
179 ancestor, the Q-card is used to identify a single check-in or a small
180 range of check-ins which were cherry-picked for inclusion in or
181 exclusion from the the current manifest. The first argument of
182 the Q-card is the artifact ID of another manifest (the "target")
183 which has had its changes included or excluded in the current manifest.
184 The target is preceeded by "+" or "-" to show inclusion or
185 exclusion, respectively. The optional second argument to the
186 Q-card is another manifest artifact ID which is the "baseline"
187 for the cherry-pick. If omitted, the baseline is the primary
188 parent of the target. The
189 changes included or excluded consist of all changes moving from
190 the baseline to the target.
191
192 The Q-card was added to the interface specification on 2011-02-26.
193 Older versions of Fossil will reject manifests that contain Q-cards.
194
195 A manifest may optionally have a single R-card. The R-card has
196 a single argument which is the MD5 checksum of all files in
197 the check-in except the manifest itself. The checksum is expressed
198 as 32-characters of lowercase hexadecimal. The checksum is
@@ -614,10 +634,20 @@
634 <td><b>P</b> <i>uuid ...</i></td>
635 <td align=center><b>X</b></td>
636 <td align=center>&nbsp;</td>
637 <td align=center>&nbsp;</td>
638 <td align=center><b>X</b></td>
639 <td align=center>&nbsp;</td>
640 <td align=center>&nbsp;</td>
641 <td align=center>&nbsp;</td>
642 </tr>
643 <tr>
644 <td><b>Q</b> (<b>+</b>|<b>-</b>)<i>uuid uuid</i></td>
645 <td align=center><b>X</b></td>
646 <td align=center>&nbsp;</td>
647 <td align=center>&nbsp;</td>
648 <td align=center>&nbsp;</td>
649 <td align=center>&nbsp;</td>
650 <td align=center>&nbsp;</td>
651 <td align=center>&nbsp;</td>
652 </tr>
653 <tr>
654

Keyboard Shortcuts

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