Fossil SCM

Fix the manifest_reparent_checkin() routine so that the "parent" tag will actually work.

drh 2020-08-16 17:47 trunk
Commit 2bdbbc8a0ef8427144643e66f75d1de6b045f98eb3a70fb0fd597718c8ff00c7
1 file changed +2 -6
+2 -6
--- src/manifest.c
+++ src/manifest.c
@@ -1796,24 +1796,20 @@
17961796
if( !hname_validate(z, j) ) goto reparent_abort;
17971797
if( z[j]==0 ) break;
17981798
z[j] = 0;
17991799
i += j;
18001800
}
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);
18061802
if( p!=0 ){
18071803
db_multi_exec(
18081804
"DELETE FROM plink WHERE cid=%d;"
18091805
"DELETE FROM mlink WHERE mid=%d;",
18101806
rid, rid
18111807
);
18121808
manifest_add_checkin_linkages(rid,p,nParent,azParent);
1809
+ manifest_destroy(p);
18131810
}
1814
- manifest_destroy(p);
18151811
reparent_abort:
18161812
fossil_free(azParent);
18171813
fossil_free(zCopy);
18181814
}
18191815
18201816
--- 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

Keyboard Shortcuts

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