Fossil SCM

New --integrate option to "fossil [/help?cmd=merge|merge]", which automatically closes the merged branch when committing.

jan.nijtmans 2013-08-01 07:51 trunk merge
Commit 69dd259eb27d207c00d5909388e15e6e96a340c7
--- src/checkin.c
+++ src/checkin.c
@@ -108,10 +108,14 @@
108108
}else if( isChnged ){
109109
if( isChnged==2 ){
110110
blob_appendf(report, "UPDATED_BY_MERGE %s\n", zDisplayName);
111111
}else if( isChnged==3 ){
112112
blob_appendf(report, "ADDED_BY_MERGE %s\n", zDisplayName);
113
+ }else if( isChnged==4 ){
114
+ blob_appendf(report, "UPDATED_BY_INTEGRATE %s\n", zDisplayName);
115
+ }else if( isChnged==5 ){
116
+ blob_appendf(report, "ADDED_BY_INTEGRATE %s\n", zDisplayName);
113117
}else if( file_contains_merge_marker(zFullName) ){
114118
blob_appendf(report, "CONFLICT %s\n", zDisplayName);
115119
}else{
116120
blob_appendf(report, "EDITED %s\n", zDisplayName);
117121
}
@@ -129,10 +133,11 @@
129133
while( db_step(&q)==SQLITE_ROW ){
130134
const char *zLabel = "MERGED_WITH";
131135
switch( db_column_int(&q, 1) ){
132136
case -1: zLabel = "CHERRYPICK "; break;
133137
case -2: zLabel = "BACKOUT "; break;
138
+ case -4: zLabel = "INTEGRATE "; break;
134139
}
135140
blob_append(report, zPrefix, nPrefix);
136141
blob_appendf(report, "%s %s\n", zLabel, db_column_text(&q, 0));
137142
}
138143
db_finalize(&q);
@@ -332,10 +337,14 @@
332337
}else if( chnged ){
333338
if( chnged==2 ){
334339
type = "UPDATED_BY_MERGE ";
335340
}else if( chnged==3 ){
336341
type = "ADDED_BY_MERGE ";
342
+ }else if( chnged==4 ){
343
+ type = "UPDATED_BY_INTEGRATE ";
344
+ }else if( chnged==5 ){
345
+ type = "ADDED_BY_INTEGRATE ";
337346
}else if( file_contains_merge_marker(zFullName) ){
338347
type = "CONFLICT ";
339348
}else{
340349
type = "EDITED ";
341350
}
@@ -1678,10 +1687,43 @@
16781687
** and rollback the transaction.
16791688
*/
16801689
if( dryRunFlag ){
16811690
blob_write_to_file(&manifest, "");
16821691
}
1692
+
1693
+ db_prepare(&q, "SELECT uuid,merge FROM vmerge JOIN blob ON merge=rid"
1694
+ " WHERE id=-4");
1695
+ while( db_step(&q)==SQLITE_ROW ){
1696
+ const char *zIntegrateUuid = db_column_text(&q, 0);
1697
+ int rid = db_column_int(&q, 1);
1698
+ if( !is_a_leaf(rid) ){
1699
+ fossil_print("Not_Closed: %s (not a leaf any more)\n", zIntegrateUuid);
1700
+ }else{
1701
+ if (!db_exists("SELECT 1 FROM tagxref "
1702
+ " WHERE tagid=%d AND rid=%d AND tagtype>0",
1703
+ TAG_CLOSED, rid)
1704
+ ){
1705
+ Blob ctrl;
1706
+ Blob cksum;
1707
+ char *zNow;
1708
+ int nrid;
1709
+
1710
+ blob_zero(&ctrl);
1711
+ zNow = date_in_standard_format("now");
1712
+ blob_appendf(&ctrl, "D %s\n", zNow);
1713
+ blob_appendf(&ctrl, "T +closed %s\n", zIntegrateUuid);
1714
+ blob_appendf(&ctrl, "U %F\n", g.zLogin);
1715
+ md5sum_blob(&ctrl, &cksum);
1716
+ blob_appendf(&ctrl, "Z %b\n", &cksum);
1717
+ nrid = content_put(&ctrl);
1718
+ manifest_crosslink(nrid, &ctrl);
1719
+ assert( blob_is_reset(&ctrl) );
1720
+ }
1721
+ fossil_print("Closed: %s\n", zIntegrateUuid);
1722
+ }
1723
+ }
1724
+ db_finalize(&q);
16831725
16841726
if( outputManifest ){
16851727
zManifestFile = mprintf("%smanifest", g.zLocalRoot);
16861728
blob_write_to_file(&manifest, zManifestFile);
16871729
blob_reset(&manifest);
16881730
--- src/checkin.c
+++ src/checkin.c
@@ -108,10 +108,14 @@
108 }else if( isChnged ){
109 if( isChnged==2 ){
110 blob_appendf(report, "UPDATED_BY_MERGE %s\n", zDisplayName);
111 }else if( isChnged==3 ){
112 blob_appendf(report, "ADDED_BY_MERGE %s\n", zDisplayName);
 
 
 
 
113 }else if( file_contains_merge_marker(zFullName) ){
114 blob_appendf(report, "CONFLICT %s\n", zDisplayName);
115 }else{
116 blob_appendf(report, "EDITED %s\n", zDisplayName);
117 }
@@ -129,10 +133,11 @@
129 while( db_step(&q)==SQLITE_ROW ){
130 const char *zLabel = "MERGED_WITH";
131 switch( db_column_int(&q, 1) ){
132 case -1: zLabel = "CHERRYPICK "; break;
133 case -2: zLabel = "BACKOUT "; break;
 
134 }
135 blob_append(report, zPrefix, nPrefix);
136 blob_appendf(report, "%s %s\n", zLabel, db_column_text(&q, 0));
137 }
138 db_finalize(&q);
@@ -332,10 +337,14 @@
332 }else if( chnged ){
333 if( chnged==2 ){
334 type = "UPDATED_BY_MERGE ";
335 }else if( chnged==3 ){
336 type = "ADDED_BY_MERGE ";
 
 
 
 
337 }else if( file_contains_merge_marker(zFullName) ){
338 type = "CONFLICT ";
339 }else{
340 type = "EDITED ";
341 }
@@ -1678,10 +1687,43 @@
1678 ** and rollback the transaction.
1679 */
1680 if( dryRunFlag ){
1681 blob_write_to_file(&manifest, "");
1682 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1683
1684 if( outputManifest ){
1685 zManifestFile = mprintf("%smanifest", g.zLocalRoot);
1686 blob_write_to_file(&manifest, zManifestFile);
1687 blob_reset(&manifest);
1688
--- src/checkin.c
+++ src/checkin.c
@@ -108,10 +108,14 @@
108 }else if( isChnged ){
109 if( isChnged==2 ){
110 blob_appendf(report, "UPDATED_BY_MERGE %s\n", zDisplayName);
111 }else if( isChnged==3 ){
112 blob_appendf(report, "ADDED_BY_MERGE %s\n", zDisplayName);
113 }else if( isChnged==4 ){
114 blob_appendf(report, "UPDATED_BY_INTEGRATE %s\n", zDisplayName);
115 }else if( isChnged==5 ){
116 blob_appendf(report, "ADDED_BY_INTEGRATE %s\n", zDisplayName);
117 }else if( file_contains_merge_marker(zFullName) ){
118 blob_appendf(report, "CONFLICT %s\n", zDisplayName);
119 }else{
120 blob_appendf(report, "EDITED %s\n", zDisplayName);
121 }
@@ -129,10 +133,11 @@
133 while( db_step(&q)==SQLITE_ROW ){
134 const char *zLabel = "MERGED_WITH";
135 switch( db_column_int(&q, 1) ){
136 case -1: zLabel = "CHERRYPICK "; break;
137 case -2: zLabel = "BACKOUT "; break;
138 case -4: zLabel = "INTEGRATE "; break;
139 }
140 blob_append(report, zPrefix, nPrefix);
141 blob_appendf(report, "%s %s\n", zLabel, db_column_text(&q, 0));
142 }
143 db_finalize(&q);
@@ -332,10 +337,14 @@
337 }else if( chnged ){
338 if( chnged==2 ){
339 type = "UPDATED_BY_MERGE ";
340 }else if( chnged==3 ){
341 type = "ADDED_BY_MERGE ";
342 }else if( chnged==4 ){
343 type = "UPDATED_BY_INTEGRATE ";
344 }else if( chnged==5 ){
345 type = "ADDED_BY_INTEGRATE ";
346 }else if( file_contains_merge_marker(zFullName) ){
347 type = "CONFLICT ";
348 }else{
349 type = "EDITED ";
350 }
@@ -1678,10 +1687,43 @@
1687 ** and rollback the transaction.
1688 */
1689 if( dryRunFlag ){
1690 blob_write_to_file(&manifest, "");
1691 }
1692
1693 db_prepare(&q, "SELECT uuid,merge FROM vmerge JOIN blob ON merge=rid"
1694 " WHERE id=-4");
1695 while( db_step(&q)==SQLITE_ROW ){
1696 const char *zIntegrateUuid = db_column_text(&q, 0);
1697 int rid = db_column_int(&q, 1);
1698 if( !is_a_leaf(rid) ){
1699 fossil_print("Not_Closed: %s (not a leaf any more)\n", zIntegrateUuid);
1700 }else{
1701 if (!db_exists("SELECT 1 FROM tagxref "
1702 " WHERE tagid=%d AND rid=%d AND tagtype>0",
1703 TAG_CLOSED, rid)
1704 ){
1705 Blob ctrl;
1706 Blob cksum;
1707 char *zNow;
1708 int nrid;
1709
1710 blob_zero(&ctrl);
1711 zNow = date_in_standard_format("now");
1712 blob_appendf(&ctrl, "D %s\n", zNow);
1713 blob_appendf(&ctrl, "T +closed %s\n", zIntegrateUuid);
1714 blob_appendf(&ctrl, "U %F\n", g.zLogin);
1715 md5sum_blob(&ctrl, &cksum);
1716 blob_appendf(&ctrl, "Z %b\n", &cksum);
1717 nrid = content_put(&ctrl);
1718 manifest_crosslink(nrid, &ctrl);
1719 assert( blob_is_reset(&ctrl) );
1720 }
1721 fossil_print("Closed: %s\n", zIntegrateUuid);
1722 }
1723 }
1724 db_finalize(&q);
1725
1726 if( outputManifest ){
1727 zManifestFile = mprintf("%smanifest", g.zLocalRoot);
1728 blob_write_to_file(&manifest, zManifestFile);
1729 blob_reset(&manifest);
1730
--- src/checkin.c
+++ src/checkin.c
@@ -108,10 +108,14 @@
108108
}else if( isChnged ){
109109
if( isChnged==2 ){
110110
blob_appendf(report, "UPDATED_BY_MERGE %s\n", zDisplayName);
111111
}else if( isChnged==3 ){
112112
blob_appendf(report, "ADDED_BY_MERGE %s\n", zDisplayName);
113
+ }else if( isChnged==4 ){
114
+ blob_appendf(report, "UPDATED_BY_INTEGRATE %s\n", zDisplayName);
115
+ }else if( isChnged==5 ){
116
+ blob_appendf(report, "ADDED_BY_INTEGRATE %s\n", zDisplayName);
113117
}else if( file_contains_merge_marker(zFullName) ){
114118
blob_appendf(report, "CONFLICT %s\n", zDisplayName);
115119
}else{
116120
blob_appendf(report, "EDITED %s\n", zDisplayName);
117121
}
@@ -129,10 +133,11 @@
129133
while( db_step(&q)==SQLITE_ROW ){
130134
const char *zLabel = "MERGED_WITH";
131135
switch( db_column_int(&q, 1) ){
132136
case -1: zLabel = "CHERRYPICK "; break;
133137
case -2: zLabel = "BACKOUT "; break;
138
+ case -4: zLabel = "INTEGRATE "; break;
134139
}
135140
blob_append(report, zPrefix, nPrefix);
136141
blob_appendf(report, "%s %s\n", zLabel, db_column_text(&q, 0));
137142
}
138143
db_finalize(&q);
@@ -332,10 +337,14 @@
332337
}else if( chnged ){
333338
if( chnged==2 ){
334339
type = "UPDATED_BY_MERGE ";
335340
}else if( chnged==3 ){
336341
type = "ADDED_BY_MERGE ";
342
+ }else if( chnged==4 ){
343
+ type = "UPDATED_BY_INTEGRATE ";
344
+ }else if( chnged==5 ){
345
+ type = "ADDED_BY_INTEGRATE ";
337346
}else if( file_contains_merge_marker(zFullName) ){
338347
type = "CONFLICT ";
339348
}else{
340349
type = "EDITED ";
341350
}
@@ -1678,10 +1687,43 @@
16781687
** and rollback the transaction.
16791688
*/
16801689
if( dryRunFlag ){
16811690
blob_write_to_file(&manifest, "");
16821691
}
1692
+
1693
+ db_prepare(&q, "SELECT uuid,merge FROM vmerge JOIN blob ON merge=rid"
1694
+ " WHERE id=-4");
1695
+ while( db_step(&q)==SQLITE_ROW ){
1696
+ const char *zIntegrateUuid = db_column_text(&q, 0);
1697
+ int rid = db_column_int(&q, 1);
1698
+ if( !is_a_leaf(rid) ){
1699
+ fossil_print("Not_Closed: %s (not a leaf any more)\n", zIntegrateUuid);
1700
+ }else{
1701
+ if (!db_exists("SELECT 1 FROM tagxref "
1702
+ " WHERE tagid=%d AND rid=%d AND tagtype>0",
1703
+ TAG_CLOSED, rid)
1704
+ ){
1705
+ Blob ctrl;
1706
+ Blob cksum;
1707
+ char *zNow;
1708
+ int nrid;
1709
+
1710
+ blob_zero(&ctrl);
1711
+ zNow = date_in_standard_format("now");
1712
+ blob_appendf(&ctrl, "D %s\n", zNow);
1713
+ blob_appendf(&ctrl, "T +closed %s\n", zIntegrateUuid);
1714
+ blob_appendf(&ctrl, "U %F\n", g.zLogin);
1715
+ md5sum_blob(&ctrl, &cksum);
1716
+ blob_appendf(&ctrl, "Z %b\n", &cksum);
1717
+ nrid = content_put(&ctrl);
1718
+ manifest_crosslink(nrid, &ctrl);
1719
+ assert( blob_is_reset(&ctrl) );
1720
+ }
1721
+ fossil_print("Closed: %s\n", zIntegrateUuid);
1722
+ }
1723
+ }
1724
+ db_finalize(&q);
16831725
16841726
if( outputManifest ){
16851727
zManifestFile = mprintf("%smanifest", g.zLocalRoot);
16861728
blob_write_to_file(&manifest, zManifestFile);
16871729
blob_reset(&manifest);
16881730
--- src/checkin.c
+++ src/checkin.c
@@ -108,10 +108,14 @@
108 }else if( isChnged ){
109 if( isChnged==2 ){
110 blob_appendf(report, "UPDATED_BY_MERGE %s\n", zDisplayName);
111 }else if( isChnged==3 ){
112 blob_appendf(report, "ADDED_BY_MERGE %s\n", zDisplayName);
 
 
 
 
113 }else if( file_contains_merge_marker(zFullName) ){
114 blob_appendf(report, "CONFLICT %s\n", zDisplayName);
115 }else{
116 blob_appendf(report, "EDITED %s\n", zDisplayName);
117 }
@@ -129,10 +133,11 @@
129 while( db_step(&q)==SQLITE_ROW ){
130 const char *zLabel = "MERGED_WITH";
131 switch( db_column_int(&q, 1) ){
132 case -1: zLabel = "CHERRYPICK "; break;
133 case -2: zLabel = "BACKOUT "; break;
 
134 }
135 blob_append(report, zPrefix, nPrefix);
136 blob_appendf(report, "%s %s\n", zLabel, db_column_text(&q, 0));
137 }
138 db_finalize(&q);
@@ -332,10 +337,14 @@
332 }else if( chnged ){
333 if( chnged==2 ){
334 type = "UPDATED_BY_MERGE ";
335 }else if( chnged==3 ){
336 type = "ADDED_BY_MERGE ";
 
 
 
 
337 }else if( file_contains_merge_marker(zFullName) ){
338 type = "CONFLICT ";
339 }else{
340 type = "EDITED ";
341 }
@@ -1678,10 +1687,43 @@
1678 ** and rollback the transaction.
1679 */
1680 if( dryRunFlag ){
1681 blob_write_to_file(&manifest, "");
1682 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1683
1684 if( outputManifest ){
1685 zManifestFile = mprintf("%smanifest", g.zLocalRoot);
1686 blob_write_to_file(&manifest, zManifestFile);
1687 blob_reset(&manifest);
1688
--- src/checkin.c
+++ src/checkin.c
@@ -108,10 +108,14 @@
108 }else if( isChnged ){
109 if( isChnged==2 ){
110 blob_appendf(report, "UPDATED_BY_MERGE %s\n", zDisplayName);
111 }else if( isChnged==3 ){
112 blob_appendf(report, "ADDED_BY_MERGE %s\n", zDisplayName);
113 }else if( isChnged==4 ){
114 blob_appendf(report, "UPDATED_BY_INTEGRATE %s\n", zDisplayName);
115 }else if( isChnged==5 ){
116 blob_appendf(report, "ADDED_BY_INTEGRATE %s\n", zDisplayName);
117 }else if( file_contains_merge_marker(zFullName) ){
118 blob_appendf(report, "CONFLICT %s\n", zDisplayName);
119 }else{
120 blob_appendf(report, "EDITED %s\n", zDisplayName);
121 }
@@ -129,10 +133,11 @@
133 while( db_step(&q)==SQLITE_ROW ){
134 const char *zLabel = "MERGED_WITH";
135 switch( db_column_int(&q, 1) ){
136 case -1: zLabel = "CHERRYPICK "; break;
137 case -2: zLabel = "BACKOUT "; break;
138 case -4: zLabel = "INTEGRATE "; break;
139 }
140 blob_append(report, zPrefix, nPrefix);
141 blob_appendf(report, "%s %s\n", zLabel, db_column_text(&q, 0));
142 }
143 db_finalize(&q);
@@ -332,10 +337,14 @@
337 }else if( chnged ){
338 if( chnged==2 ){
339 type = "UPDATED_BY_MERGE ";
340 }else if( chnged==3 ){
341 type = "ADDED_BY_MERGE ";
342 }else if( chnged==4 ){
343 type = "UPDATED_BY_INTEGRATE ";
344 }else if( chnged==5 ){
345 type = "ADDED_BY_INTEGRATE ";
346 }else if( file_contains_merge_marker(zFullName) ){
347 type = "CONFLICT ";
348 }else{
349 type = "EDITED ";
350 }
@@ -1678,10 +1687,43 @@
1687 ** and rollback the transaction.
1688 */
1689 if( dryRunFlag ){
1690 blob_write_to_file(&manifest, "");
1691 }
1692
1693 db_prepare(&q, "SELECT uuid,merge FROM vmerge JOIN blob ON merge=rid"
1694 " WHERE id=-4");
1695 while( db_step(&q)==SQLITE_ROW ){
1696 const char *zIntegrateUuid = db_column_text(&q, 0);
1697 int rid = db_column_int(&q, 1);
1698 if( !is_a_leaf(rid) ){
1699 fossil_print("Not_Closed: %s (not a leaf any more)\n", zIntegrateUuid);
1700 }else{
1701 if (!db_exists("SELECT 1 FROM tagxref "
1702 " WHERE tagid=%d AND rid=%d AND tagtype>0",
1703 TAG_CLOSED, rid)
1704 ){
1705 Blob ctrl;
1706 Blob cksum;
1707 char *zNow;
1708 int nrid;
1709
1710 blob_zero(&ctrl);
1711 zNow = date_in_standard_format("now");
1712 blob_appendf(&ctrl, "D %s\n", zNow);
1713 blob_appendf(&ctrl, "T +closed %s\n", zIntegrateUuid);
1714 blob_appendf(&ctrl, "U %F\n", g.zLogin);
1715 md5sum_blob(&ctrl, &cksum);
1716 blob_appendf(&ctrl, "Z %b\n", &cksum);
1717 nrid = content_put(&ctrl);
1718 manifest_crosslink(nrid, &ctrl);
1719 assert( blob_is_reset(&ctrl) );
1720 }
1721 fossil_print("Closed: %s\n", zIntegrateUuid);
1722 }
1723 }
1724 db_finalize(&q);
1725
1726 if( outputManifest ){
1727 zManifestFile = mprintf("%smanifest", g.zLocalRoot);
1728 blob_write_to_file(&manifest, zManifestFile);
1729 blob_reset(&manifest);
1730
--- src/json_status.c
+++ src/json_status.c
@@ -157,10 +157,11 @@
157157
while( db_step(&q)==SQLITE_ROW ){
158158
const char *zLabel = "MERGED_WITH";
159159
switch( db_column_int(&q, 1) ){
160160
case -1: zLabel = "CHERRYPICK "; break;
161161
case -2: zLabel = "BACKOUT "; break;
162
+ case -4: zLabel = "INTEGRATE "; break;
162163
}
163164
blob_append(report, zPrefix, nPrefix);
164165
blob_appendf(report, "%s %s\n", zLabel, db_column_text(&q, 0));
165166
}
166167
db_finalize(&q);
167168
--- src/json_status.c
+++ src/json_status.c
@@ -157,10 +157,11 @@
157 while( db_step(&q)==SQLITE_ROW ){
158 const char *zLabel = "MERGED_WITH";
159 switch( db_column_int(&q, 1) ){
160 case -1: zLabel = "CHERRYPICK "; break;
161 case -2: zLabel = "BACKOUT "; break;
 
162 }
163 blob_append(report, zPrefix, nPrefix);
164 blob_appendf(report, "%s %s\n", zLabel, db_column_text(&q, 0));
165 }
166 db_finalize(&q);
167
--- src/json_status.c
+++ src/json_status.c
@@ -157,10 +157,11 @@
157 while( db_step(&q)==SQLITE_ROW ){
158 const char *zLabel = "MERGED_WITH";
159 switch( db_column_int(&q, 1) ){
160 case -1: zLabel = "CHERRYPICK "; break;
161 case -2: zLabel = "BACKOUT "; break;
162 case -4: zLabel = "INTEGRATE "; break;
163 }
164 blob_append(report, zPrefix, nPrefix);
165 blob_appendf(report, "%s %s\n", zLabel, db_column_text(&q, 0));
166 }
167 db_finalize(&q);
168
+20 -7
--- src/merge.c
+++ src/merge.c
@@ -91,19 +91,22 @@
9191
** files whose names differ only in case are taken
9292
** to be the same file.
9393
**
9494
** -f|--force Force the merge even if it would be a no-op.
9595
**
96
+** --integrate Merged branch will be closed when committing.
97
+**
9698
** -n|--dry-run If given, display instead of run actions
9799
**
98100
** -v|--verbose Show additional details of the merge
99101
*/
100102
void merge_cmd(void){
101103
int vid; /* Current version "V" */
102104
int mid; /* Version we are merging from "M" */
103105
int pid; /* The pivot version - most recent common ancestor P */
104106
int verboseFlag; /* True if the -v|--verbose option is present */
107
+ int integrateFlag; /* True if the --integrate option is present */
105108
int pickFlag; /* True if the --cherrypick option is present */
106109
int backoutFlag; /* True if the --backout option is present */
107110
int dryRunFlag; /* True if the --dry-run or -n option is present */
108111
int forceFlag; /* True if the --force or -f option is present */
109112
const char *zBinGlob; /* The value of --binary */
@@ -128,10 +131,11 @@
128131
verboseFlag = find_option("verbose","v",0)!=0;
129132
if( !verboseFlag ){
130133
verboseFlag = find_option("detail",0,0)!=0; /* deprecated */
131134
}
132135
pickFlag = find_option("cherrypick",0,0)!=0;
136
+ integrateFlag = find_option("integrate",0,0)!=0;
133137
backoutFlag = find_option("backout",0,0)!=0;
134138
debugFlag = find_option("debug",0,0)!=0;
135139
zBinGlob = find_option("binary",0,1);
136140
dryRunFlag = find_option("dry-run","n",0)!=0;
137141
if( !dryRunFlag ){
@@ -162,12 +166,12 @@
162166
** has not already been merged into the current checkout and (3)
163167
** the leaf is not closed and (4) the leaf is in the same branch
164168
** as the current checkout.
165169
*/
166170
Stmt q;
167
- if( pickFlag || backoutFlag ){
168
- fossil_fatal("cannot use --cherrypick or --backout with a fork merge");
171
+ if( pickFlag || backoutFlag || integrateFlag){
172
+ fossil_fatal("cannot use --backout, --cherrypick or --integrate with a fork merge");
169173
}
170174
mid = db_int(0,
171175
"SELECT leaf.rid"
172176
" FROM leaf, event"
173177
" WHERE leaf.rid=event.objid"
@@ -220,10 +224,13 @@
220224
}
221225
if( pickFlag ){
222226
fossil_fatal("incompatible options: --cherrypick & --baseline");
223227
}
224228
}else if( pickFlag || backoutFlag ){
229
+ if( integrateFlag ){
230
+ fossil_fatal("incompatible options: --integrate & --cherrypick or --backout");
231
+ }
225232
pid = db_int(0, "SELECT pid FROM plink WHERE cid=%d AND isprim", mid);
226233
if( pid<=0 ){
227234
fossil_fatal("cannot find an ancestor for %s", g.argv[2]);
228235
}
229236
}else{
@@ -251,12 +258,16 @@
251258
if( !forceFlag && mid==pid ){
252259
fossil_print("Merge skipped because it is a no-op. "
253260
" Use --force to override.\n");
254261
return;
255262
}
263
+ if( integrateFlag && !is_a_leaf(mid) ){
264
+ fossil_warning("ignoring --integrate: %s is not a leaf", g.argv[2]);
265
+ integrateFlag = 0;
266
+ }
256267
if( verboseFlag ){
257
- print_checkin_description(mid, 12, "merge-from:");
268
+ print_checkin_description(mid, 12, integrateFlag?"integrate:":"merge-from:");
258269
print_checkin_description(pid, 12, "baseline:");
259270
}
260271
vfile_check_signature(vid, CKSIG_ENOTFILE);
261272
db_begin_transaction();
262273
if( !dryRunFlag ) undo_begin();
@@ -434,12 +445,12 @@
434445
int idv;
435446
const char *zName;
436447
char *zFullName;
437448
db_multi_exec(
438449
"INSERT INTO vfile(vid,chnged,deleted,rid,mrid,isexe,islink,pathname)"
439
- " SELECT %d,3,0,rid,mrid,isexe,islink,pathname FROM vfile WHERE id=%d",
440
- vid, idm
450
+ " SELECT %d,%d,0,rid,mrid,isexe,islink,pathname FROM vfile WHERE id=%d",
451
+ vid, integrateFlag?5:3, idm
441452
);
442453
idv = db_last_insert_rowid();
443454
db_multi_exec("UPDATE fv SET idv=%d WHERE rowid=%d", idv, rowid);
444455
zName = db_column_text(&q, 2);
445456
zFullName = mprintf("%s%s", g.zLocalRoot, zName);
@@ -474,12 +485,12 @@
474485
/* Copy content from idm over into idv. Overwrite idv. */
475486
fossil_print("UPDATE %s\n", zName);
476487
if( !dryRunFlag ){
477488
undo_save(zName);
478489
db_multi_exec(
479
- "UPDATE vfile SET mtime=0, mrid=%d, chnged=2, islink=%d "
480
- " WHERE id=%d", ridm, islinkm, idv
490
+ "UPDATE vfile SET mtime=0, mrid=%d, chnged=%d, islink=%d "
491
+ " WHERE id=%d", ridm, integrateFlag?4:2, islinkm, idv
481492
);
482493
vfile_to_disk(0, idv, 0, 0);
483494
}
484495
}
485496
db_finalize(&q);
@@ -644,11 +655,13 @@
644655
" WHERE type='ci' AND objid=%d",
645656
mid
646657
);
647658
}else if( backoutFlag ){
648659
db_multi_exec("INSERT OR IGNORE INTO vmerge(id,merge) VALUES(-2,%d)",pid);
660
+ }else if( integrateFlag ){
661
+ db_multi_exec("INSERT OR IGNORE INTO vmerge(id,merge) VALUES(-4,%d)",mid);
649662
}else{
650663
db_multi_exec("INSERT OR IGNORE INTO vmerge(id,merge) VALUES(0,%d)", mid);
651664
}
652665
undo_finish();
653666
db_end_transaction(dryRunFlag);
654667
}
655668
--- src/merge.c
+++ src/merge.c
@@ -91,19 +91,22 @@
91 ** files whose names differ only in case are taken
92 ** to be the same file.
93 **
94 ** -f|--force Force the merge even if it would be a no-op.
95 **
 
 
96 ** -n|--dry-run If given, display instead of run actions
97 **
98 ** -v|--verbose Show additional details of the merge
99 */
100 void merge_cmd(void){
101 int vid; /* Current version "V" */
102 int mid; /* Version we are merging from "M" */
103 int pid; /* The pivot version - most recent common ancestor P */
104 int verboseFlag; /* True if the -v|--verbose option is present */
 
105 int pickFlag; /* True if the --cherrypick option is present */
106 int backoutFlag; /* True if the --backout option is present */
107 int dryRunFlag; /* True if the --dry-run or -n option is present */
108 int forceFlag; /* True if the --force or -f option is present */
109 const char *zBinGlob; /* The value of --binary */
@@ -128,10 +131,11 @@
128 verboseFlag = find_option("verbose","v",0)!=0;
129 if( !verboseFlag ){
130 verboseFlag = find_option("detail",0,0)!=0; /* deprecated */
131 }
132 pickFlag = find_option("cherrypick",0,0)!=0;
 
133 backoutFlag = find_option("backout",0,0)!=0;
134 debugFlag = find_option("debug",0,0)!=0;
135 zBinGlob = find_option("binary",0,1);
136 dryRunFlag = find_option("dry-run","n",0)!=0;
137 if( !dryRunFlag ){
@@ -162,12 +166,12 @@
162 ** has not already been merged into the current checkout and (3)
163 ** the leaf is not closed and (4) the leaf is in the same branch
164 ** as the current checkout.
165 */
166 Stmt q;
167 if( pickFlag || backoutFlag ){
168 fossil_fatal("cannot use --cherrypick or --backout with a fork merge");
169 }
170 mid = db_int(0,
171 "SELECT leaf.rid"
172 " FROM leaf, event"
173 " WHERE leaf.rid=event.objid"
@@ -220,10 +224,13 @@
220 }
221 if( pickFlag ){
222 fossil_fatal("incompatible options: --cherrypick & --baseline");
223 }
224 }else if( pickFlag || backoutFlag ){
 
 
 
225 pid = db_int(0, "SELECT pid FROM plink WHERE cid=%d AND isprim", mid);
226 if( pid<=0 ){
227 fossil_fatal("cannot find an ancestor for %s", g.argv[2]);
228 }
229 }else{
@@ -251,12 +258,16 @@
251 if( !forceFlag && mid==pid ){
252 fossil_print("Merge skipped because it is a no-op. "
253 " Use --force to override.\n");
254 return;
255 }
 
 
 
 
256 if( verboseFlag ){
257 print_checkin_description(mid, 12, "merge-from:");
258 print_checkin_description(pid, 12, "baseline:");
259 }
260 vfile_check_signature(vid, CKSIG_ENOTFILE);
261 db_begin_transaction();
262 if( !dryRunFlag ) undo_begin();
@@ -434,12 +445,12 @@
434 int idv;
435 const char *zName;
436 char *zFullName;
437 db_multi_exec(
438 "INSERT INTO vfile(vid,chnged,deleted,rid,mrid,isexe,islink,pathname)"
439 " SELECT %d,3,0,rid,mrid,isexe,islink,pathname FROM vfile WHERE id=%d",
440 vid, idm
441 );
442 idv = db_last_insert_rowid();
443 db_multi_exec("UPDATE fv SET idv=%d WHERE rowid=%d", idv, rowid);
444 zName = db_column_text(&q, 2);
445 zFullName = mprintf("%s%s", g.zLocalRoot, zName);
@@ -474,12 +485,12 @@
474 /* Copy content from idm over into idv. Overwrite idv. */
475 fossil_print("UPDATE %s\n", zName);
476 if( !dryRunFlag ){
477 undo_save(zName);
478 db_multi_exec(
479 "UPDATE vfile SET mtime=0, mrid=%d, chnged=2, islink=%d "
480 " WHERE id=%d", ridm, islinkm, idv
481 );
482 vfile_to_disk(0, idv, 0, 0);
483 }
484 }
485 db_finalize(&q);
@@ -644,11 +655,13 @@
644 " WHERE type='ci' AND objid=%d",
645 mid
646 );
647 }else if( backoutFlag ){
648 db_multi_exec("INSERT OR IGNORE INTO vmerge(id,merge) VALUES(-2,%d)",pid);
 
 
649 }else{
650 db_multi_exec("INSERT OR IGNORE INTO vmerge(id,merge) VALUES(0,%d)", mid);
651 }
652 undo_finish();
653 db_end_transaction(dryRunFlag);
654 }
655
--- src/merge.c
+++ src/merge.c
@@ -91,19 +91,22 @@
91 ** files whose names differ only in case are taken
92 ** to be the same file.
93 **
94 ** -f|--force Force the merge even if it would be a no-op.
95 **
96 ** --integrate Merged branch will be closed when committing.
97 **
98 ** -n|--dry-run If given, display instead of run actions
99 **
100 ** -v|--verbose Show additional details of the merge
101 */
102 void merge_cmd(void){
103 int vid; /* Current version "V" */
104 int mid; /* Version we are merging from "M" */
105 int pid; /* The pivot version - most recent common ancestor P */
106 int verboseFlag; /* True if the -v|--verbose option is present */
107 int integrateFlag; /* True if the --integrate option is present */
108 int pickFlag; /* True if the --cherrypick option is present */
109 int backoutFlag; /* True if the --backout option is present */
110 int dryRunFlag; /* True if the --dry-run or -n option is present */
111 int forceFlag; /* True if the --force or -f option is present */
112 const char *zBinGlob; /* The value of --binary */
@@ -128,10 +131,11 @@
131 verboseFlag = find_option("verbose","v",0)!=0;
132 if( !verboseFlag ){
133 verboseFlag = find_option("detail",0,0)!=0; /* deprecated */
134 }
135 pickFlag = find_option("cherrypick",0,0)!=0;
136 integrateFlag = find_option("integrate",0,0)!=0;
137 backoutFlag = find_option("backout",0,0)!=0;
138 debugFlag = find_option("debug",0,0)!=0;
139 zBinGlob = find_option("binary",0,1);
140 dryRunFlag = find_option("dry-run","n",0)!=0;
141 if( !dryRunFlag ){
@@ -162,12 +166,12 @@
166 ** has not already been merged into the current checkout and (3)
167 ** the leaf is not closed and (4) the leaf is in the same branch
168 ** as the current checkout.
169 */
170 Stmt q;
171 if( pickFlag || backoutFlag || integrateFlag){
172 fossil_fatal("cannot use --backout, --cherrypick or --integrate with a fork merge");
173 }
174 mid = db_int(0,
175 "SELECT leaf.rid"
176 " FROM leaf, event"
177 " WHERE leaf.rid=event.objid"
@@ -220,10 +224,13 @@
224 }
225 if( pickFlag ){
226 fossil_fatal("incompatible options: --cherrypick & --baseline");
227 }
228 }else if( pickFlag || backoutFlag ){
229 if( integrateFlag ){
230 fossil_fatal("incompatible options: --integrate & --cherrypick or --backout");
231 }
232 pid = db_int(0, "SELECT pid FROM plink WHERE cid=%d AND isprim", mid);
233 if( pid<=0 ){
234 fossil_fatal("cannot find an ancestor for %s", g.argv[2]);
235 }
236 }else{
@@ -251,12 +258,16 @@
258 if( !forceFlag && mid==pid ){
259 fossil_print("Merge skipped because it is a no-op. "
260 " Use --force to override.\n");
261 return;
262 }
263 if( integrateFlag && !is_a_leaf(mid) ){
264 fossil_warning("ignoring --integrate: %s is not a leaf", g.argv[2]);
265 integrateFlag = 0;
266 }
267 if( verboseFlag ){
268 print_checkin_description(mid, 12, integrateFlag?"integrate:":"merge-from:");
269 print_checkin_description(pid, 12, "baseline:");
270 }
271 vfile_check_signature(vid, CKSIG_ENOTFILE);
272 db_begin_transaction();
273 if( !dryRunFlag ) undo_begin();
@@ -434,12 +445,12 @@
445 int idv;
446 const char *zName;
447 char *zFullName;
448 db_multi_exec(
449 "INSERT INTO vfile(vid,chnged,deleted,rid,mrid,isexe,islink,pathname)"
450 " SELECT %d,%d,0,rid,mrid,isexe,islink,pathname FROM vfile WHERE id=%d",
451 vid, integrateFlag?5:3, idm
452 );
453 idv = db_last_insert_rowid();
454 db_multi_exec("UPDATE fv SET idv=%d WHERE rowid=%d", idv, rowid);
455 zName = db_column_text(&q, 2);
456 zFullName = mprintf("%s%s", g.zLocalRoot, zName);
@@ -474,12 +485,12 @@
485 /* Copy content from idm over into idv. Overwrite idv. */
486 fossil_print("UPDATE %s\n", zName);
487 if( !dryRunFlag ){
488 undo_save(zName);
489 db_multi_exec(
490 "UPDATE vfile SET mtime=0, mrid=%d, chnged=%d, islink=%d "
491 " WHERE id=%d", ridm, integrateFlag?4:2, islinkm, idv
492 );
493 vfile_to_disk(0, idv, 0, 0);
494 }
495 }
496 db_finalize(&q);
@@ -644,11 +655,13 @@
655 " WHERE type='ci' AND objid=%d",
656 mid
657 );
658 }else if( backoutFlag ){
659 db_multi_exec("INSERT OR IGNORE INTO vmerge(id,merge) VALUES(-2,%d)",pid);
660 }else if( integrateFlag ){
661 db_multi_exec("INSERT OR IGNORE INTO vmerge(id,merge) VALUES(-4,%d)",mid);
662 }else{
663 db_multi_exec("INSERT OR IGNORE INTO vmerge(id,merge) VALUES(0,%d)", mid);
664 }
665 undo_finish();
666 db_end_transaction(dryRunFlag);
667 }
668
+11 -10
--- src/schema.c
+++ src/schema.c
@@ -475,25 +475,25 @@
475475
@ --
476476
@ -- The file.rid field is 0 for files or folders that have been
477477
@ -- added but not yet committed.
478478
@ --
479479
@ -- Vfile.chnged is 0 for unmodified files, 1 for files that have
480
-@ -- been edited or which have been subjected to a 3-way merge.
480
+@ -- been edited or which have been subjected to a 3-way merge.
481481
@ -- Vfile.chnged is 2 if the file has been replaced from a different
482482
@ -- version by the merge and 3 if the file has been added by a merge.
483
-@ -- The difference between vfile.chnged==2 and a regular add is that
484
-@ -- with vfile.chnged==2 we know that the current version of the file
485
-@ -- is already in the repository.
486
-@ --
483
+@ -- Vfile.chnged is 4|5 is the same as 2|3, but the operation has been
484
+@ -- done by an --integrate merge. The difference between vfile.chnged==2|4
485
+@ -- and a regular add is that with vfile.chnged==2|4 we know that the
486
+@ -- current version of the file is already in the repository.
487487
@ --
488488
@ CREATE TABLE vfile(
489489
@ id INTEGER PRIMARY KEY, -- ID of the checked out file
490490
@ vid INTEGER REFERENCES blob, -- The baseline this file is part of.
491
-@ chnged INT DEFAULT 0, -- 0:unchnged 1:edited 2:m-chng 3:m-add
492
-@ deleted BOOLEAN DEFAULT 0, -- True if deleted
491
+@ chnged INT DEFAULT 0, -- 0:unchnged 1:edited 2:m-chng 3:m-add 4:i-chng 5:i-add
492
+@ deleted BOOLEAN DEFAULT 0, -- True if deleted
493493
@ isexe BOOLEAN, -- True if file should be executable
494
-@ islink BOOLEAN, -- True if file should be symlink
494
+@ islink BOOLEAN, -- True if file should be symlink
495495
@ rid INTEGER, -- Originally from this repository record
496496
@ mrid INTEGER, -- Based on this record due to a merge
497497
@ mtime INTEGER, -- Mtime of file on disk. sec since 1970
498498
@ pathname TEXT, -- Full pathname relative to root
499499
@ origname TEXT, -- Original pathname. NULL if unchanged
@@ -502,12 +502,13 @@
502502
@
503503
@ -- This table holds a record of uncommitted merges in the local
504504
@ -- file tree. If a VFILE entry with id has merged with another
505505
@ -- record, there is an entry in this table with (id,merge) where
506506
@ -- merge is the RECORD table entry that the file merged against.
507
-@ -- An id of 0 here means the version record itself. When id==(-1)
508
-@ -- that is a cherrypick merge and id==(-2) is a backout merge.
507
+@ -- An id of 0 or <-3 here means the version record itself. When
508
+@ -- id==(-1) that is a cherrypick merge, id==(-2) that is a
509
+@ -- backout merge and id==(-4) is a integrate merge.
509510
@
510511
@ CREATE TABLE vmerge(
511512
@ id INTEGER REFERENCES vfile, -- VFILE entry that has been merged
512513
@ merge INTEGER, -- Merged with this record
513514
@ UNIQUE(id, merge)
514515
--- src/schema.c
+++ src/schema.c
@@ -475,25 +475,25 @@
475 @ --
476 @ -- The file.rid field is 0 for files or folders that have been
477 @ -- added but not yet committed.
478 @ --
479 @ -- Vfile.chnged is 0 for unmodified files, 1 for files that have
480 @ -- been edited or which have been subjected to a 3-way merge.
481 @ -- Vfile.chnged is 2 if the file has been replaced from a different
482 @ -- version by the merge and 3 if the file has been added by a merge.
483 @ -- The difference between vfile.chnged==2 and a regular add is that
484 @ -- with vfile.chnged==2 we know that the current version of the file
485 @ -- is already in the repository.
486 @ --
487 @ --
488 @ CREATE TABLE vfile(
489 @ id INTEGER PRIMARY KEY, -- ID of the checked out file
490 @ vid INTEGER REFERENCES blob, -- The baseline this file is part of.
491 @ chnged INT DEFAULT 0, -- 0:unchnged 1:edited 2:m-chng 3:m-add
492 @ deleted BOOLEAN DEFAULT 0, -- True if deleted
493 @ isexe BOOLEAN, -- True if file should be executable
494 @ islink BOOLEAN, -- True if file should be symlink
495 @ rid INTEGER, -- Originally from this repository record
496 @ mrid INTEGER, -- Based on this record due to a merge
497 @ mtime INTEGER, -- Mtime of file on disk. sec since 1970
498 @ pathname TEXT, -- Full pathname relative to root
499 @ origname TEXT, -- Original pathname. NULL if unchanged
@@ -502,12 +502,13 @@
502 @
503 @ -- This table holds a record of uncommitted merges in the local
504 @ -- file tree. If a VFILE entry with id has merged with another
505 @ -- record, there is an entry in this table with (id,merge) where
506 @ -- merge is the RECORD table entry that the file merged against.
507 @ -- An id of 0 here means the version record itself. When id==(-1)
508 @ -- that is a cherrypick merge and id==(-2) is a backout merge.
 
509 @
510 @ CREATE TABLE vmerge(
511 @ id INTEGER REFERENCES vfile, -- VFILE entry that has been merged
512 @ merge INTEGER, -- Merged with this record
513 @ UNIQUE(id, merge)
514
--- src/schema.c
+++ src/schema.c
@@ -475,25 +475,25 @@
475 @ --
476 @ -- The file.rid field is 0 for files or folders that have been
477 @ -- added but not yet committed.
478 @ --
479 @ -- Vfile.chnged is 0 for unmodified files, 1 for files that have
480 @ -- been edited or which have been subjected to a 3-way merge.
481 @ -- Vfile.chnged is 2 if the file has been replaced from a different
482 @ -- version by the merge and 3 if the file has been added by a merge.
483 @ -- Vfile.chnged is 4|5 is the same as 2|3, but the operation has been
484 @ -- done by an --integrate merge. The difference between vfile.chnged==2|4
485 @ -- and a regular add is that with vfile.chnged==2|4 we know that the
486 @ -- current version of the file is already in the repository.
487 @ --
488 @ CREATE TABLE vfile(
489 @ id INTEGER PRIMARY KEY, -- ID of the checked out file
490 @ vid INTEGER REFERENCES blob, -- The baseline this file is part of.
491 @ chnged INT DEFAULT 0, -- 0:unchnged 1:edited 2:m-chng 3:m-add 4:i-chng 5:i-add
492 @ deleted BOOLEAN DEFAULT 0, -- True if deleted
493 @ isexe BOOLEAN, -- True if file should be executable
494 @ islink BOOLEAN, -- True if file should be symlink
495 @ rid INTEGER, -- Originally from this repository record
496 @ mrid INTEGER, -- Based on this record due to a merge
497 @ mtime INTEGER, -- Mtime of file on disk. sec since 1970
498 @ pathname TEXT, -- Full pathname relative to root
499 @ origname TEXT, -- Original pathname. NULL if unchanged
@@ -502,12 +502,13 @@
502 @
503 @ -- This table holds a record of uncommitted merges in the local
504 @ -- file tree. If a VFILE entry with id has merged with another
505 @ -- record, there is an entry in this table with (id,merge) where
506 @ -- merge is the RECORD table entry that the file merged against.
507 @ -- An id of 0 or <-3 here means the version record itself. When
508 @ -- id==(-1) that is a cherrypick merge, id==(-2) that is a
509 @ -- backout merge and id==(-4) is a integrate merge.
510 @
511 @ CREATE TABLE vmerge(
512 @ id INTEGER REFERENCES vfile, -- VFILE entry that has been merged
513 @ merge INTEGER, -- Merged with this record
514 @ UNIQUE(id, merge)
515
+11 -10
--- src/schema.c
+++ src/schema.c
@@ -475,25 +475,25 @@
475475
@ --
476476
@ -- The file.rid field is 0 for files or folders that have been
477477
@ -- added but not yet committed.
478478
@ --
479479
@ -- Vfile.chnged is 0 for unmodified files, 1 for files that have
480
-@ -- been edited or which have been subjected to a 3-way merge.
480
+@ -- been edited or which have been subjected to a 3-way merge.
481481
@ -- Vfile.chnged is 2 if the file has been replaced from a different
482482
@ -- version by the merge and 3 if the file has been added by a merge.
483
-@ -- The difference between vfile.chnged==2 and a regular add is that
484
-@ -- with vfile.chnged==2 we know that the current version of the file
485
-@ -- is already in the repository.
486
-@ --
483
+@ -- Vfile.chnged is 4|5 is the same as 2|3, but the operation has been
484
+@ -- done by an --integrate merge. The difference between vfile.chnged==2|4
485
+@ -- and a regular add is that with vfile.chnged==2|4 we know that the
486
+@ -- current version of the file is already in the repository.
487487
@ --
488488
@ CREATE TABLE vfile(
489489
@ id INTEGER PRIMARY KEY, -- ID of the checked out file
490490
@ vid INTEGER REFERENCES blob, -- The baseline this file is part of.
491
-@ chnged INT DEFAULT 0, -- 0:unchnged 1:edited 2:m-chng 3:m-add
492
-@ deleted BOOLEAN DEFAULT 0, -- True if deleted
491
+@ chnged INT DEFAULT 0, -- 0:unchnged 1:edited 2:m-chng 3:m-add 4:i-chng 5:i-add
492
+@ deleted BOOLEAN DEFAULT 0, -- True if deleted
493493
@ isexe BOOLEAN, -- True if file should be executable
494
-@ islink BOOLEAN, -- True if file should be symlink
494
+@ islink BOOLEAN, -- True if file should be symlink
495495
@ rid INTEGER, -- Originally from this repository record
496496
@ mrid INTEGER, -- Based on this record due to a merge
497497
@ mtime INTEGER, -- Mtime of file on disk. sec since 1970
498498
@ pathname TEXT, -- Full pathname relative to root
499499
@ origname TEXT, -- Original pathname. NULL if unchanged
@@ -502,12 +502,13 @@
502502
@
503503
@ -- This table holds a record of uncommitted merges in the local
504504
@ -- file tree. If a VFILE entry with id has merged with another
505505
@ -- record, there is an entry in this table with (id,merge) where
506506
@ -- merge is the RECORD table entry that the file merged against.
507
-@ -- An id of 0 here means the version record itself. When id==(-1)
508
-@ -- that is a cherrypick merge and id==(-2) is a backout merge.
507
+@ -- An id of 0 or <-3 here means the version record itself. When
508
+@ -- id==(-1) that is a cherrypick merge, id==(-2) that is a
509
+@ -- backout merge and id==(-4) is a integrate merge.
509510
@
510511
@ CREATE TABLE vmerge(
511512
@ id INTEGER REFERENCES vfile, -- VFILE entry that has been merged
512513
@ merge INTEGER, -- Merged with this record
513514
@ UNIQUE(id, merge)
514515
--- src/schema.c
+++ src/schema.c
@@ -475,25 +475,25 @@
475 @ --
476 @ -- The file.rid field is 0 for files or folders that have been
477 @ -- added but not yet committed.
478 @ --
479 @ -- Vfile.chnged is 0 for unmodified files, 1 for files that have
480 @ -- been edited or which have been subjected to a 3-way merge.
481 @ -- Vfile.chnged is 2 if the file has been replaced from a different
482 @ -- version by the merge and 3 if the file has been added by a merge.
483 @ -- The difference between vfile.chnged==2 and a regular add is that
484 @ -- with vfile.chnged==2 we know that the current version of the file
485 @ -- is already in the repository.
486 @ --
487 @ --
488 @ CREATE TABLE vfile(
489 @ id INTEGER PRIMARY KEY, -- ID of the checked out file
490 @ vid INTEGER REFERENCES blob, -- The baseline this file is part of.
491 @ chnged INT DEFAULT 0, -- 0:unchnged 1:edited 2:m-chng 3:m-add
492 @ deleted BOOLEAN DEFAULT 0, -- True if deleted
493 @ isexe BOOLEAN, -- True if file should be executable
494 @ islink BOOLEAN, -- True if file should be symlink
495 @ rid INTEGER, -- Originally from this repository record
496 @ mrid INTEGER, -- Based on this record due to a merge
497 @ mtime INTEGER, -- Mtime of file on disk. sec since 1970
498 @ pathname TEXT, -- Full pathname relative to root
499 @ origname TEXT, -- Original pathname. NULL if unchanged
@@ -502,12 +502,13 @@
502 @
503 @ -- This table holds a record of uncommitted merges in the local
504 @ -- file tree. If a VFILE entry with id has merged with another
505 @ -- record, there is an entry in this table with (id,merge) where
506 @ -- merge is the RECORD table entry that the file merged against.
507 @ -- An id of 0 here means the version record itself. When id==(-1)
508 @ -- that is a cherrypick merge and id==(-2) is a backout merge.
 
509 @
510 @ CREATE TABLE vmerge(
511 @ id INTEGER REFERENCES vfile, -- VFILE entry that has been merged
512 @ merge INTEGER, -- Merged with this record
513 @ UNIQUE(id, merge)
514
--- src/schema.c
+++ src/schema.c
@@ -475,25 +475,25 @@
475 @ --
476 @ -- The file.rid field is 0 for files or folders that have been
477 @ -- added but not yet committed.
478 @ --
479 @ -- Vfile.chnged is 0 for unmodified files, 1 for files that have
480 @ -- been edited or which have been subjected to a 3-way merge.
481 @ -- Vfile.chnged is 2 if the file has been replaced from a different
482 @ -- version by the merge and 3 if the file has been added by a merge.
483 @ -- Vfile.chnged is 4|5 is the same as 2|3, but the operation has been
484 @ -- done by an --integrate merge. The difference between vfile.chnged==2|4
485 @ -- and a regular add is that with vfile.chnged==2|4 we know that the
486 @ -- current version of the file is already in the repository.
487 @ --
488 @ CREATE TABLE vfile(
489 @ id INTEGER PRIMARY KEY, -- ID of the checked out file
490 @ vid INTEGER REFERENCES blob, -- The baseline this file is part of.
491 @ chnged INT DEFAULT 0, -- 0:unchnged 1:edited 2:m-chng 3:m-add 4:i-chng 5:i-add
492 @ deleted BOOLEAN DEFAULT 0, -- True if deleted
493 @ isexe BOOLEAN, -- True if file should be executable
494 @ islink BOOLEAN, -- True if file should be symlink
495 @ rid INTEGER, -- Originally from this repository record
496 @ mrid INTEGER, -- Based on this record due to a merge
497 @ mtime INTEGER, -- Mtime of file on disk. sec since 1970
498 @ pathname TEXT, -- Full pathname relative to root
499 @ origname TEXT, -- Original pathname. NULL if unchanged
@@ -502,12 +502,13 @@
502 @
503 @ -- This table holds a record of uncommitted merges in the local
504 @ -- file tree. If a VFILE entry with id has merged with another
505 @ -- record, there is an entry in this table with (id,merge) where
506 @ -- merge is the RECORD table entry that the file merged against.
507 @ -- An id of 0 or <-3 here means the version record itself. When
508 @ -- id==(-1) that is a cherrypick merge, id==(-2) that is a
509 @ -- backout merge and id==(-4) is a integrate merge.
510 @
511 @ CREATE TABLE vmerge(
512 @ id INTEGER REFERENCES vfile, -- VFILE entry that has been merged
513 @ merge INTEGER, -- Merged with this record
514 @ UNIQUE(id, merge)
515
+2 -2
--- src/vfile.c
+++ src/vfile.c
@@ -213,11 +213,11 @@
213213
blob_zero(&fileCksum);
214214
}
215215
if( blob_compare(&fileCksum, &origCksum)==0 ) chnged = 0;
216216
blob_reset(&origCksum);
217217
blob_reset(&fileCksum);
218
- }else if( (chnged==0 || chnged==2)
218
+ }else if( (chnged==0 || chnged==2 || chnged==4)
219219
&& (useMtime==0 || currentMtime!=oldMtime) ){
220220
/* For files that were formerly believed to be unchanged or that were
221221
** changed by merging, if their mtime changes, or unconditionally
222222
** if --sha1sum is used, check to see if they have been edited by
223223
** looking at their SHA1 sum */
@@ -230,11 +230,11 @@
230230
chnged = 1;
231231
}
232232
blob_reset(&origCksum);
233233
blob_reset(&fileCksum);
234234
}
235
- if( (cksigFlags & CKSIG_SETMTIME) && (chnged==0 || chnged==2) ){
235
+ if( (cksigFlags & CKSIG_SETMTIME) && (chnged==0 || chnged==2 || chnged==4) ){
236236
i64 desiredMtime;
237237
if( mtime_of_manifest_file(vid,rid,&desiredMtime)==0 ){
238238
if( currentMtime!=desiredMtime ){
239239
file_set_mtime(zName, desiredMtime);
240240
currentMtime = file_wd_mtime(zName);
241241
--- src/vfile.c
+++ src/vfile.c
@@ -213,11 +213,11 @@
213 blob_zero(&fileCksum);
214 }
215 if( blob_compare(&fileCksum, &origCksum)==0 ) chnged = 0;
216 blob_reset(&origCksum);
217 blob_reset(&fileCksum);
218 }else if( (chnged==0 || chnged==2)
219 && (useMtime==0 || currentMtime!=oldMtime) ){
220 /* For files that were formerly believed to be unchanged or that were
221 ** changed by merging, if their mtime changes, or unconditionally
222 ** if --sha1sum is used, check to see if they have been edited by
223 ** looking at their SHA1 sum */
@@ -230,11 +230,11 @@
230 chnged = 1;
231 }
232 blob_reset(&origCksum);
233 blob_reset(&fileCksum);
234 }
235 if( (cksigFlags & CKSIG_SETMTIME) && (chnged==0 || chnged==2) ){
236 i64 desiredMtime;
237 if( mtime_of_manifest_file(vid,rid,&desiredMtime)==0 ){
238 if( currentMtime!=desiredMtime ){
239 file_set_mtime(zName, desiredMtime);
240 currentMtime = file_wd_mtime(zName);
241
--- src/vfile.c
+++ src/vfile.c
@@ -213,11 +213,11 @@
213 blob_zero(&fileCksum);
214 }
215 if( blob_compare(&fileCksum, &origCksum)==0 ) chnged = 0;
216 blob_reset(&origCksum);
217 blob_reset(&fileCksum);
218 }else if( (chnged==0 || chnged==2 || chnged==4)
219 && (useMtime==0 || currentMtime!=oldMtime) ){
220 /* For files that were formerly believed to be unchanged or that were
221 ** changed by merging, if their mtime changes, or unconditionally
222 ** if --sha1sum is used, check to see if they have been edited by
223 ** looking at their SHA1 sum */
@@ -230,11 +230,11 @@
230 chnged = 1;
231 }
232 blob_reset(&origCksum);
233 blob_reset(&fileCksum);
234 }
235 if( (cksigFlags & CKSIG_SETMTIME) && (chnged==0 || chnged==2 || chnged==4) ){
236 i64 desiredMtime;
237 if( mtime_of_manifest_file(vid,rid,&desiredMtime)==0 ){
238 if( currentMtime!=desiredMtime ){
239 file_set_mtime(zName, desiredMtime);
240 currentMtime = file_wd_mtime(zName);
241
--- win/Makefile.mingw
+++ win/Makefile.mingw
@@ -13,15 +13,15 @@
1313
#
1414
1515
#### Select one of MinGW, MinGW-w64 (32-bit) or MinGW-w64 (64-bit) compilers.
1616
# By default, this is an empty string (i.e. use the native compiler).
1717
#
18
-PREFIX =
18
+# PREFIX =
1919
# PREFIX = mingw32-
2020
# PREFIX = i686-pc-mingw32-
2121
# PREFIX = i686-w64-mingw32-
22
-# PREFIX = x86_64-w64-mingw32-
22
+PREFIX = x86_64-w64-mingw32-
2323
2424
#### The toplevel directory of the source tree. Fossil can be built
2525
# in a directory that is separate from the source tree. Just change
2626
# the following to point from the build directory to the src/ folder.
2727
#
2828
--- win/Makefile.mingw
+++ win/Makefile.mingw
@@ -13,15 +13,15 @@
13 #
14
15 #### Select one of MinGW, MinGW-w64 (32-bit) or MinGW-w64 (64-bit) compilers.
16 # By default, this is an empty string (i.e. use the native compiler).
17 #
18 PREFIX =
19 # PREFIX = mingw32-
20 # PREFIX = i686-pc-mingw32-
21 # PREFIX = i686-w64-mingw32-
22 # PREFIX = x86_64-w64-mingw32-
23
24 #### The toplevel directory of the source tree. Fossil can be built
25 # in a directory that is separate from the source tree. Just change
26 # the following to point from the build directory to the src/ folder.
27 #
28
--- win/Makefile.mingw
+++ win/Makefile.mingw
@@ -13,15 +13,15 @@
13 #
14
15 #### Select one of MinGW, MinGW-w64 (32-bit) or MinGW-w64 (64-bit) compilers.
16 # By default, this is an empty string (i.e. use the native compiler).
17 #
18 # PREFIX =
19 # PREFIX = mingw32-
20 # PREFIX = i686-pc-mingw32-
21 # PREFIX = i686-w64-mingw32-
22 PREFIX = x86_64-w64-mingw32-
23
24 #### The toplevel directory of the source tree. Fossil can be built
25 # in a directory that is separate from the source tree. Just change
26 # the following to point from the build directory to the src/ folder.
27 #
28
--- win/Makefile.mingw
+++ win/Makefile.mingw
@@ -13,15 +13,15 @@
1313
#
1414
1515
#### Select one of MinGW, MinGW-w64 (32-bit) or MinGW-w64 (64-bit) compilers.
1616
# By default, this is an empty string (i.e. use the native compiler).
1717
#
18
-PREFIX =
18
+# PREFIX =
1919
# PREFIX = mingw32-
2020
# PREFIX = i686-pc-mingw32-
2121
# PREFIX = i686-w64-mingw32-
22
-# PREFIX = x86_64-w64-mingw32-
22
+PREFIX = x86_64-w64-mingw32-
2323
2424
#### The toplevel directory of the source tree. Fossil can be built
2525
# in a directory that is separate from the source tree. Just change
2626
# the following to point from the build directory to the src/ folder.
2727
#
2828
--- win/Makefile.mingw
+++ win/Makefile.mingw
@@ -13,15 +13,15 @@
13 #
14
15 #### Select one of MinGW, MinGW-w64 (32-bit) or MinGW-w64 (64-bit) compilers.
16 # By default, this is an empty string (i.e. use the native compiler).
17 #
18 PREFIX =
19 # PREFIX = mingw32-
20 # PREFIX = i686-pc-mingw32-
21 # PREFIX = i686-w64-mingw32-
22 # PREFIX = x86_64-w64-mingw32-
23
24 #### The toplevel directory of the source tree. Fossil can be built
25 # in a directory that is separate from the source tree. Just change
26 # the following to point from the build directory to the src/ folder.
27 #
28
--- win/Makefile.mingw
+++ win/Makefile.mingw
@@ -13,15 +13,15 @@
13 #
14
15 #### Select one of MinGW, MinGW-w64 (32-bit) or MinGW-w64 (64-bit) compilers.
16 # By default, this is an empty string (i.e. use the native compiler).
17 #
18 # PREFIX =
19 # PREFIX = mingw32-
20 # PREFIX = i686-pc-mingw32-
21 # PREFIX = i686-w64-mingw32-
22 PREFIX = x86_64-w64-mingw32-
23
24 #### The toplevel directory of the source tree. Fossil can be built
25 # in a directory that is separate from the source tree. Just change
26 # the following to point from the build directory to the src/ folder.
27 #
28
--- www/changes.wiki
+++ www/changes.wiki
@@ -3,10 +3,12 @@
33
<h2>Changes For Version 1.27 (as yet unreleased)</h2>
44
* Enhance the [/help?cmd=changes | fossil changes],
55
[/help?cmd=clean | fossil clean], [/help?cmd=extras | fossil extras],
66
[/help?cmd=ls | fossil ls] and [/help?cmd=status | fossil status] commands
77
to restrict operation to files and directories named on the command-line.
8
+ * New --integrate option to [/help?cmd=merge | fossil merge], which
9
+ automatically closes the merged branch when committing.
810
911
<h2>Changes For Version 1.26 (2013-06-18)</h2>
1012
* The argument to the --port option for the [/help?cmd=ui | fossil ui] and
1113
[/help?cmd=server | fossil server] commands can take an IP address in addition
1214
to the port number, causing Fossil to bind to just that one IP address.
1315
--- www/changes.wiki
+++ www/changes.wiki
@@ -3,10 +3,12 @@
3 <h2>Changes For Version 1.27 (as yet unreleased)</h2>
4 * Enhance the [/help?cmd=changes | fossil changes],
5 [/help?cmd=clean | fossil clean], [/help?cmd=extras | fossil extras],
6 [/help?cmd=ls | fossil ls] and [/help?cmd=status | fossil status] commands
7 to restrict operation to files and directories named on the command-line.
 
 
8
9 <h2>Changes For Version 1.26 (2013-06-18)</h2>
10 * The argument to the --port option for the [/help?cmd=ui | fossil ui] and
11 [/help?cmd=server | fossil server] commands can take an IP address in addition
12 to the port number, causing Fossil to bind to just that one IP address.
13
--- www/changes.wiki
+++ www/changes.wiki
@@ -3,10 +3,12 @@
3 <h2>Changes For Version 1.27 (as yet unreleased)</h2>
4 * Enhance the [/help?cmd=changes | fossil changes],
5 [/help?cmd=clean | fossil clean], [/help?cmd=extras | fossil extras],
6 [/help?cmd=ls | fossil ls] and [/help?cmd=status | fossil status] commands
7 to restrict operation to files and directories named on the command-line.
8 * New --integrate option to [/help?cmd=merge | fossil merge], which
9 automatically closes the merged branch when committing.
10
11 <h2>Changes For Version 1.26 (2013-06-18)</h2>
12 * The argument to the --port option for the [/help?cmd=ui | fossil ui] and
13 [/help?cmd=server | fossil server] commands can take an IP address in addition
14 to the port number, causing Fossil to bind to just that one IP address.
15

Keyboard Shortcuts

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