Fossil SCM
Attempt to distinguish between files added from nothing and files added by merge.
Commit
0d73f3f67055fbcd0f73d8c894c38acba07adc03
Parent
acd670f2519599a…
2 files changed
+2
-3
+12
-10
+2
-3
| --- src/manifest.c | ||
| +++ src/manifest.c | ||
| @@ -1801,14 +1801,13 @@ | ||
| 1801 | 1801 | pid, rid, i==0, p->rDate, zBaseId/*safe-for-%s*/); |
| 1802 | 1802 | add_mlink(pid, 0, rid, p, i==0); |
| 1803 | 1803 | if( i==0 ) parentid = pid; |
| 1804 | 1804 | } |
| 1805 | 1805 | if( p->nParent>1 ){ |
| 1806 | - /* Remove incorrect MLINK create-file entries that arise when a | |
| 1807 | - ** file is added by merge. */ | |
| 1806 | + /* Change MLINK.PID from 0 to -1 for files that are added by merge. */ | |
| 1808 | 1807 | db_multi_exec( |
| 1809 | - "DELETE FROM mlink" | |
| 1808 | + "UPDATE mlink SET pid=-1" | |
| 1810 | 1809 | " WHERE mid=%d" |
| 1811 | 1810 | " AND pid=0" |
| 1812 | 1811 | " AND fnid IN " |
| 1813 | 1812 | " (SELECT fnid FROM mlink WHERE mid=%d GROUP BY fnid" |
| 1814 | 1813 | " HAVING count(*)<%d)", |
| 1815 | 1814 |
| --- src/manifest.c | |
| +++ src/manifest.c | |
| @@ -1801,14 +1801,13 @@ | |
| 1801 | pid, rid, i==0, p->rDate, zBaseId/*safe-for-%s*/); |
| 1802 | add_mlink(pid, 0, rid, p, i==0); |
| 1803 | if( i==0 ) parentid = pid; |
| 1804 | } |
| 1805 | if( p->nParent>1 ){ |
| 1806 | /* Remove incorrect MLINK create-file entries that arise when a |
| 1807 | ** file is added by merge. */ |
| 1808 | db_multi_exec( |
| 1809 | "DELETE FROM mlink" |
| 1810 | " WHERE mid=%d" |
| 1811 | " AND pid=0" |
| 1812 | " AND fnid IN " |
| 1813 | " (SELECT fnid FROM mlink WHERE mid=%d GROUP BY fnid" |
| 1814 | " HAVING count(*)<%d)", |
| 1815 |
| --- src/manifest.c | |
| +++ src/manifest.c | |
| @@ -1801,14 +1801,13 @@ | |
| 1801 | pid, rid, i==0, p->rDate, zBaseId/*safe-for-%s*/); |
| 1802 | add_mlink(pid, 0, rid, p, i==0); |
| 1803 | if( i==0 ) parentid = pid; |
| 1804 | } |
| 1805 | if( p->nParent>1 ){ |
| 1806 | /* Change MLINK.PID from 0 to -1 for files that are added by merge. */ |
| 1807 | db_multi_exec( |
| 1808 | "UPDATE mlink SET pid=-1" |
| 1809 | " WHERE mid=%d" |
| 1810 | " AND pid=0" |
| 1811 | " AND fnid IN " |
| 1812 | " (SELECT fnid FROM mlink WHERE mid=%d GROUP BY fnid" |
| 1813 | " HAVING count(*)<%d)", |
| 1814 |
+12
-10
| --- src/schema.c | ||
| +++ src/schema.c | ||
| @@ -249,22 +249,24 @@ | ||
| 249 | 249 | @ -- pid = Parent file ID. |
| 250 | 250 | @ -- fnid = File Name ID. |
| 251 | 251 | @ -- pfnid = Parent File Name ID. |
| 252 | 252 | @ -- isaux = pmid IS AUXiliary parent, not primary parent |
| 253 | 253 | @ -- |
| 254 | -@ -- pid==0 if the file is added by check-in mid. | |
| 255 | -@ -- fid==0 if the file is removed by check-in mid. | |
| 254 | +@ -- pid==0 if the file is added by check-in mid. | |
| 255 | +@ -- pid==(-1) if the file exists in a merge parents but not in the primary | |
| 256 | +@ -- parent. In other words, if the file file was added by merge. | |
| 257 | +@ -- fid==0 if the file is removed by check-in mid. | |
| 256 | 258 | @ -- |
| 257 | 259 | @ CREATE TABLE mlink( |
| 258 | -@ mid INTEGER REFERENCES plink(cid), -- Check-in that contains fid | |
| 259 | -@ fid INTEGER REFERENCES blob, -- New file content. 0 if deleted | |
| 260 | -@ pmid INTEGER REFERENCES plink(cid), -- Check-in that contains pid | |
| 261 | -@ pid INTEGER REFERENCES blob, -- Prev file content. 0 if new | |
| 262 | -@ fnid INTEGER REFERENCES filename, -- Name of the file | |
| 263 | -@ pfnid INTEGER REFERENCES filename, -- Previous name. 0 if unchanged | |
| 264 | -@ mperm INTEGER, -- File permissions. 1==exec | |
| 265 | -@ isaux BOOLEAN DEFAULT 0 -- TRUE if pmid is the primary | |
| 260 | +@ mid INTEGER, -- Check-in that contains fid | |
| 261 | +@ fid INTEGER, -- New file content. 0 if deleted | |
| 262 | +@ pmid INTEGER, -- Check-in that contains pid | |
| 263 | +@ pid INTEGER, -- Prev file content. 0 if new. -1 merge | |
| 264 | +@ fnid INTEGER REFERENCES filename, -- Name of the file | |
| 265 | +@ pfnid INTEGER REFERENCES filename, -- Previous name. 0 if unchanged | |
| 266 | +@ mperm INTEGER, -- File permissions. 1==exec | |
| 267 | +@ isaux BOOLEAN DEFAULT 0 -- TRUE if pmid is the primary | |
| 266 | 268 | @ ); |
| 267 | 269 | @ CREATE INDEX mlink_i1 ON mlink(mid); |
| 268 | 270 | @ CREATE INDEX mlink_i2 ON mlink(fnid); |
| 269 | 271 | @ CREATE INDEX mlink_i3 ON mlink(fid); |
| 270 | 272 | @ CREATE INDEX mlink_i4 ON mlink(pid); |
| 271 | 273 |
| --- src/schema.c | |
| +++ src/schema.c | |
| @@ -249,22 +249,24 @@ | |
| 249 | @ -- pid = Parent file ID. |
| 250 | @ -- fnid = File Name ID. |
| 251 | @ -- pfnid = Parent File Name ID. |
| 252 | @ -- isaux = pmid IS AUXiliary parent, not primary parent |
| 253 | @ -- |
| 254 | @ -- pid==0 if the file is added by check-in mid. |
| 255 | @ -- fid==0 if the file is removed by check-in mid. |
| 256 | @ -- |
| 257 | @ CREATE TABLE mlink( |
| 258 | @ mid INTEGER REFERENCES plink(cid), -- Check-in that contains fid |
| 259 | @ fid INTEGER REFERENCES blob, -- New file content. 0 if deleted |
| 260 | @ pmid INTEGER REFERENCES plink(cid), -- Check-in that contains pid |
| 261 | @ pid INTEGER REFERENCES blob, -- Prev file content. 0 if new |
| 262 | @ fnid INTEGER REFERENCES filename, -- Name of the file |
| 263 | @ pfnid INTEGER REFERENCES filename, -- Previous name. 0 if unchanged |
| 264 | @ mperm INTEGER, -- File permissions. 1==exec |
| 265 | @ isaux BOOLEAN DEFAULT 0 -- TRUE if pmid is the primary |
| 266 | @ ); |
| 267 | @ CREATE INDEX mlink_i1 ON mlink(mid); |
| 268 | @ CREATE INDEX mlink_i2 ON mlink(fnid); |
| 269 | @ CREATE INDEX mlink_i3 ON mlink(fid); |
| 270 | @ CREATE INDEX mlink_i4 ON mlink(pid); |
| 271 |
| --- src/schema.c | |
| +++ src/schema.c | |
| @@ -249,22 +249,24 @@ | |
| 249 | @ -- pid = Parent file ID. |
| 250 | @ -- fnid = File Name ID. |
| 251 | @ -- pfnid = Parent File Name ID. |
| 252 | @ -- isaux = pmid IS AUXiliary parent, not primary parent |
| 253 | @ -- |
| 254 | @ -- pid==0 if the file is added by check-in mid. |
| 255 | @ -- pid==(-1) if the file exists in a merge parents but not in the primary |
| 256 | @ -- parent. In other words, if the file file was added by merge. |
| 257 | @ -- fid==0 if the file is removed by check-in mid. |
| 258 | @ -- |
| 259 | @ CREATE TABLE mlink( |
| 260 | @ mid INTEGER, -- Check-in that contains fid |
| 261 | @ fid INTEGER, -- New file content. 0 if deleted |
| 262 | @ pmid INTEGER, -- Check-in that contains pid |
| 263 | @ pid INTEGER, -- Prev file content. 0 if new. -1 merge |
| 264 | @ fnid INTEGER REFERENCES filename, -- Name of the file |
| 265 | @ pfnid INTEGER REFERENCES filename, -- Previous name. 0 if unchanged |
| 266 | @ mperm INTEGER, -- File permissions. 1==exec |
| 267 | @ isaux BOOLEAN DEFAULT 0 -- TRUE if pmid is the primary |
| 268 | @ ); |
| 269 | @ CREATE INDEX mlink_i1 ON mlink(mid); |
| 270 | @ CREATE INDEX mlink_i2 ON mlink(fnid); |
| 271 | @ CREATE INDEX mlink_i3 ON mlink(fid); |
| 272 | @ CREATE INDEX mlink_i4 ON mlink(pid); |
| 273 |