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.
Commit
4ac43fe6e33d434b67aac66978f582a30ae3592c
Parent
a39a992b4e02a92…
1 file changed
+27
+27
| --- src/manifest.c | ||
| +++ src/manifest.c | ||
| @@ -1692,10 +1692,19 @@ | ||
| 1692 | 1692 | ); |
| 1693 | 1693 | zCom = db_text(0, "SELECT coalesce(ecomment, comment) FROM event" |
| 1694 | 1694 | " WHERE rowid=last_insert_rowid()"); |
| 1695 | 1695 | wiki_extract_links(zCom, rid, 0, p->rDate, 1, WIKI_INLINE); |
| 1696 | 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 | + ); | |
| 1697 | 1706 | |
| 1698 | 1707 | /* If this is a delta-manifest, record the fact that this repository |
| 1699 | 1708 | ** contains delta manifests, to free the "commit" logic to generate |
| 1700 | 1709 | ** new delta manifests. |
| 1701 | 1710 | */ |
| @@ -1983,5 +1992,23 @@ | ||
| 1983 | 1992 | manifest_destroy(p); |
| 1984 | 1993 | } |
| 1985 | 1994 | assert( blob_is_reset(pContent) ); |
| 1986 | 1995 | return 1; |
| 1987 | 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 | +} | |
| 1988 | 2015 |
| --- 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 |