Fossil SCM

When a file is renamed, do not show it has having been deleted in addition to being renamed. After upgrading through this change, you must run "fossil rebuild" for the fix to take effect.

drh 2012-12-18 01:39 UTC trunk
Commit 4ac43fe6e33d434b67aac66978f582a30ae3592c
1 file changed +27
--- src/manifest.c
+++ src/manifest.c
@@ -1692,10 +1692,19 @@
16921692
);
16931693
zCom = db_text(0, "SELECT coalesce(ecomment, comment) FROM event"
16941694
" WHERE rowid=last_insert_rowid()");
16951695
wiki_extract_links(zCom, rid, 0, p->rDate, 1, WIKI_INLINE);
16961696
free(zCom);
1697
+
1698
+ /* Remove file-delete entries if there is also a file-rename entry */
1699
+ db_multi_exec(
1700
+ "DELETE FROM mlink"
1701
+ " WHERE mid=%d"
1702
+ " AND fid=0"
1703
+ " AND fnid IN (SELECT pfnid FROM mlink WHERE mid=%d);",
1704
+ rid, rid
1705
+ );
16971706
16981707
/* If this is a delta-manifest, record the fact that this repository
16991708
** contains delta manifests, to free the "commit" logic to generate
17001709
** new delta manifests.
17011710
*/
@@ -1983,5 +1992,23 @@
19831992
manifest_destroy(p);
19841993
}
19851994
assert( blob_is_reset(pContent) );
19861995
return 1;
19871996
}
1997
+
1998
+/*
1999
+** COMMAND: test-crosslink
2000
+**
2001
+** Usage: %fossil test-crosslink RECORDID
2002
+**
2003
+** Run the manifest_crosslink() routine on the artifact with the given
2004
+** record ID. This is typically done in the debugger.
2005
+*/
2006
+void test_crosslink_cmd(void){
2007
+ int rid;
2008
+ Blob content;
2009
+ db_find_and_open_repository(0, 0);
2010
+ if( g.argc!=3 ) usage("RECORDID");
2011
+ rid = name_to_rid(g.argv[2]);
2012
+ content_get(rid, &content);
2013
+ manifest_crosslink(rid, &content);
2014
+}
19882015
--- src/manifest.c
+++ src/manifest.c
@@ -1692,10 +1692,19 @@
1692 );
1693 zCom = db_text(0, "SELECT coalesce(ecomment, comment) FROM event"
1694 " WHERE rowid=last_insert_rowid()");
1695 wiki_extract_links(zCom, rid, 0, p->rDate, 1, WIKI_INLINE);
1696 free(zCom);
 
 
 
 
 
 
 
 
 
1697
1698 /* If this is a delta-manifest, record the fact that this repository
1699 ** contains delta manifests, to free the "commit" logic to generate
1700 ** new delta manifests.
1701 */
@@ -1983,5 +1992,23 @@
1983 manifest_destroy(p);
1984 }
1985 assert( blob_is_reset(pContent) );
1986 return 1;
1987 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1988
--- src/manifest.c
+++ src/manifest.c
@@ -1692,10 +1692,19 @@
1692 );
1693 zCom = db_text(0, "SELECT coalesce(ecomment, comment) FROM event"
1694 " WHERE rowid=last_insert_rowid()");
1695 wiki_extract_links(zCom, rid, 0, p->rDate, 1, WIKI_INLINE);
1696 free(zCom);
1697
1698 /* Remove file-delete entries if there is also a file-rename entry */
1699 db_multi_exec(
1700 "DELETE FROM mlink"
1701 " WHERE mid=%d"
1702 " AND fid=0"
1703 " AND fnid IN (SELECT pfnid FROM mlink WHERE mid=%d);",
1704 rid, rid
1705 );
1706
1707 /* If this is a delta-manifest, record the fact that this repository
1708 ** contains delta manifests, to free the "commit" logic to generate
1709 ** new delta manifests.
1710 */
@@ -1983,5 +1992,23 @@
1992 manifest_destroy(p);
1993 }
1994 assert( blob_is_reset(pContent) );
1995 return 1;
1996 }
1997
1998 /*
1999 ** COMMAND: test-crosslink
2000 **
2001 ** Usage: %fossil test-crosslink RECORDID
2002 **
2003 ** Run the manifest_crosslink() routine on the artifact with the given
2004 ** record ID. This is typically done in the debugger.
2005 */
2006 void test_crosslink_cmd(void){
2007 int rid;
2008 Blob content;
2009 db_find_and_open_repository(0, 0);
2010 if( g.argc!=3 ) usage("RECORDID");
2011 rid = name_to_rid(g.argv[2]);
2012 content_get(rid, &content);
2013 manifest_crosslink(rid, &content);
2014 }
2015

Keyboard Shortcuts

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