Fossil SCM
Extend the file format for manifests to include the Q-card for recording cherry-picks. Parse and ignore these cards for now.
Commit
7fcbbb1da0dd28bf2d889ed6046c53cccda47836
Parent
51c3f3b6709bf63…
2 files changed
+30
+30
+30
| --- src/manifest.c | ||
| +++ src/manifest.c | ||
| @@ -74,10 +74,15 @@ | ||
| 74 | 74 | int iFile; /* Index of current file in iterator */ |
| 75 | 75 | ManifestFile *aFile; /* One entry for each F-card */ |
| 76 | 76 | int nParent; /* Number of parents. */ |
| 77 | 77 | int nParentAlloc; /* Slots allocated in azParent[] */ |
| 78 | 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; | |
| 79 | 84 | int nCChild; /* Number of cluster children */ |
| 80 | 85 | int nCChildAlloc; /* Number of closts allocated in azCChild[] */ |
| 81 | 86 | char **azCChild; /* UUIDs of referenced objects in a cluster. M cards */ |
| 82 | 87 | int nTag; /* Number of T Cards */ |
| 83 | 88 | int nTagAlloc; /* Slots allocated in aTag[] */ |
| @@ -121,10 +126,11 @@ | ||
| 121 | 126 | free(p->aFile); |
| 122 | 127 | free(p->azParent); |
| 123 | 128 | free(p->azCChild); |
| 124 | 129 | free(p->aTag); |
| 125 | 130 | free(p->aField); |
| 131 | + free(p->aCherrypick); | |
| 126 | 132 | if( p->pBaseline ) manifest_destroy(p->pBaseline); |
| 127 | 133 | memset(p, 0, sizeof(*p)); |
| 128 | 134 | fossil_free(p); |
| 129 | 135 | } |
| 130 | 136 | } |
| @@ -624,10 +630,34 @@ | ||
| 624 | 630 | i = p->nParent++; |
| 625 | 631 | p->azParent[i] = zUuid; |
| 626 | 632 | } |
| 627 | 633 | break; |
| 628 | 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 | + } | |
| 629 | 659 | |
| 630 | 660 | /* |
| 631 | 661 | ** R <md5sum> |
| 632 | 662 | ** |
| 633 | 663 | ** Specify the MD5 checksum over the name and content of all files |
| 634 | 664 |
| --- 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 |
+30
| --- www/fileformat.wiki | ||
| +++ www/fileformat.wiki | ||
| @@ -100,10 +100,11 @@ | ||
| 100 | 100 | <b>B</b> <i>baseline-manifest</i><br> |
| 101 | 101 | <b>C</b> <i>checkin-comment</i><br> |
| 102 | 102 | <b>D</b> <i>time-and-date-stamp</i><br> |
| 103 | 103 | <b>F</b> <i>filename</i> <i>SHA1-hash</i> <i>permissions</i> <i>old-name</i><br> |
| 104 | 104 | <b>P</b> <i>SHA1-hash</i>+<br> |
| 105 | +<b>Q</b> (<b>+</b>|<b>-</b>)<i>SHA1-hash ?SHA1-hash?</i><br> | |
| 105 | 106 | <b>R</b> <i>repository-checksum</i><br> |
| 106 | 107 | <b>T</b> (<b>+</b>|<b>-</b>|<b>*</b>)<i>tag-name <b>*</b> ?value?</i><br> |
| 107 | 108 | <b>U</b> <i>user-login</i><br> |
| 108 | 109 | <b>Z</b> <i>manifest-checksum</i> |
| 109 | 110 | </blockquote> |
| @@ -169,10 +170,29 @@ | ||
| 169 | 170 | The first predecessor is the direct ancestor of the manifest. |
| 170 | 171 | Other arguments define manifests with which the first was |
| 171 | 172 | merged to yield the current manifest. Most manifests have |
| 172 | 173 | a P-card with a single argument. The first manifest in the |
| 173 | 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. | |
| 174 | 194 | |
| 175 | 195 | A manifest may optionally have a single R-card. The R-card has |
| 176 | 196 | a single argument which is the MD5 checksum of all files in |
| 177 | 197 | the check-in except the manifest itself. The checksum is expressed |
| 178 | 198 | as 32-characters of lowercase hexadecimal. The checksum is |
| @@ -614,10 +634,20 @@ | ||
| 614 | 634 | <td><b>P</b> <i>uuid ...</i></td> |
| 615 | 635 | <td align=center><b>X</b></td> |
| 616 | 636 | <td align=center> </td> |
| 617 | 637 | <td align=center> </td> |
| 618 | 638 | <td align=center><b>X</b></td> |
| 639 | +<td align=center> </td> | |
| 640 | +<td align=center> </td> | |
| 641 | +<td align=center> </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> </td> | |
| 647 | +<td align=center> </td> | |
| 648 | +<td align=center> </td> | |
| 619 | 649 | <td align=center> </td> |
| 620 | 650 | <td align=center> </td> |
| 621 | 651 | <td align=center> </td> |
| 622 | 652 | </tr> |
| 623 | 653 | <tr> |
| 624 | 654 |
| --- 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> </td> |
| 617 | <td align=center> </td> |
| 618 | <td align=center><b>X</b></td> |
| 619 | <td align=center> </td> |
| 620 | <td align=center> </td> |
| 621 | <td align=center> </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> </td> |
| 637 | <td align=center> </td> |
| 638 | <td align=center><b>X</b></td> |
| 639 | <td align=center> </td> |
| 640 | <td align=center> </td> |
| 641 | <td align=center> </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> </td> |
| 647 | <td align=center> </td> |
| 648 | <td align=center> </td> |
| 649 | <td align=center> </td> |
| 650 | <td align=center> </td> |
| 651 | <td align=center> </td> |
| 652 | </tr> |
| 653 | <tr> |
| 654 |