Fossil SCM
Fix the manifest_reparent_checkin() routine so that the "parent" tag will actually work.
Commit
2bdbbc8a0ef8427144643e66f75d1de6b045f98eb3a70fb0fd597718c8ff00c7
Parent
a02bcb033b0a159…
1 file changed
+2
-6
+2
-6
| --- src/manifest.c | ||
| +++ src/manifest.c | ||
| @@ -1796,24 +1796,20 @@ | ||
| 1796 | 1796 | if( !hname_validate(z, j) ) goto reparent_abort; |
| 1797 | 1797 | if( z[j]==0 ) break; |
| 1798 | 1798 | z[j] = 0; |
| 1799 | 1799 | i += j; |
| 1800 | 1800 | } |
| 1801 | - if( !db_exists("SELECT 1 FROM plink WHERE cid=%d AND pid=%d", | |
| 1802 | - rid, uuid_to_rid(azParent[0],0)) | |
| 1803 | - ){ | |
| 1804 | - p = manifest_get(rid, CFTYPE_MANIFEST, 0); | |
| 1805 | - } | |
| 1801 | + p = manifest_get(rid, CFTYPE_MANIFEST, 0); | |
| 1806 | 1802 | if( p!=0 ){ |
| 1807 | 1803 | db_multi_exec( |
| 1808 | 1804 | "DELETE FROM plink WHERE cid=%d;" |
| 1809 | 1805 | "DELETE FROM mlink WHERE mid=%d;", |
| 1810 | 1806 | rid, rid |
| 1811 | 1807 | ); |
| 1812 | 1808 | manifest_add_checkin_linkages(rid,p,nParent,azParent); |
| 1809 | + manifest_destroy(p); | |
| 1813 | 1810 | } |
| 1814 | - manifest_destroy(p); | |
| 1815 | 1811 | reparent_abort: |
| 1816 | 1812 | fossil_free(azParent); |
| 1817 | 1813 | fossil_free(zCopy); |
| 1818 | 1814 | } |
| 1819 | 1815 | |
| 1820 | 1816 |
| --- src/manifest.c | |
| +++ src/manifest.c | |
| @@ -1796,24 +1796,20 @@ | |
| 1796 | if( !hname_validate(z, j) ) goto reparent_abort; |
| 1797 | if( z[j]==0 ) break; |
| 1798 | z[j] = 0; |
| 1799 | i += j; |
| 1800 | } |
| 1801 | if( !db_exists("SELECT 1 FROM plink WHERE cid=%d AND pid=%d", |
| 1802 | rid, uuid_to_rid(azParent[0],0)) |
| 1803 | ){ |
| 1804 | p = manifest_get(rid, CFTYPE_MANIFEST, 0); |
| 1805 | } |
| 1806 | if( p!=0 ){ |
| 1807 | db_multi_exec( |
| 1808 | "DELETE FROM plink WHERE cid=%d;" |
| 1809 | "DELETE FROM mlink WHERE mid=%d;", |
| 1810 | rid, rid |
| 1811 | ); |
| 1812 | manifest_add_checkin_linkages(rid,p,nParent,azParent); |
| 1813 | } |
| 1814 | manifest_destroy(p); |
| 1815 | reparent_abort: |
| 1816 | fossil_free(azParent); |
| 1817 | fossil_free(zCopy); |
| 1818 | } |
| 1819 | |
| 1820 |
| --- src/manifest.c | |
| +++ src/manifest.c | |
| @@ -1796,24 +1796,20 @@ | |
| 1796 | if( !hname_validate(z, j) ) goto reparent_abort; |
| 1797 | if( z[j]==0 ) break; |
| 1798 | z[j] = 0; |
| 1799 | i += j; |
| 1800 | } |
| 1801 | p = manifest_get(rid, CFTYPE_MANIFEST, 0); |
| 1802 | if( p!=0 ){ |
| 1803 | db_multi_exec( |
| 1804 | "DELETE FROM plink WHERE cid=%d;" |
| 1805 | "DELETE FROM mlink WHERE mid=%d;", |
| 1806 | rid, rid |
| 1807 | ); |
| 1808 | manifest_add_checkin_linkages(rid,p,nParent,azParent); |
| 1809 | manifest_destroy(p); |
| 1810 | } |
| 1811 | reparent_abort: |
| 1812 | fossil_free(azParent); |
| 1813 | fossil_free(zCopy); |
| 1814 | } |
| 1815 | |
| 1816 |