Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| Comment: | Show the artifact numbers on the From and To of a file diff. |
|---|---|
| Downloads: | Tarball | ZIP archive |
| Timelines: | family | ancestors | descendants | both | trunk |
| Files: | files | file ages | folders |
| SHA1: |
9a63d1f048c53352c63a7a1359a60e81 |
| User & Date: | drh 2011-05-06 16:44:41.163 |
References
|
2011-05-06
| ||
| 19:15 | • Open ticket [f0f9aff371]: 'annotate' misses changes. plus 2 other changes ... (artifact: 22f0c355ae user: viriketo) | |
Context
|
2011-05-09
| ||
| 12:26 | Add lines describing the login to the /test_env page. ... (check-in: c53fbe5d41 user: drh tags: trunk) | |
|
2011-05-06
| ||
| 16:55 | Merge the latest trunk changes into windows-i18n branch. ... (check-in: 59ddd3c8ae user: drh tags: windows-i18n) | |
| 16:44 | Show the artifact numbers on the From and To of a file diff. ... (check-in: 9a63d1f048 user: drh tags: trunk) | |
| 16:32 | Improvements to the annotation algorithm so that if a line changes from X to Y then back to X, the annotation shows the second X not the first. Ticket [f0f9aff371f26] ... (check-in: 73c38a3add user: drh tags: trunk) | |
Changes
Changes to src/info.c.
| ︙ | ︙ | |||
947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 |
** difference between the two artifacts. Generate plaintext if "patch"
** is present.
*/
void diff_page(void){
int v1, v2;
int isPatch;
Blob c1, c2, diff, *pOut;
login_check_credentials();
if( !g.okRead ){ login_needed(); return; }
v1 = name_to_rid_www("v1");
v2 = name_to_rid_www("v2");
if( v1==0 || v2==0 ) fossil_redirect_home();
isPatch = P("patch")!=0;
if( isPatch ){
pOut = cgi_output_blob();
cgi_set_content_type("text/plain");
}else{
blob_zero(&diff);
pOut = &diff;
}
content_get(v1, &c1);
content_get(v2, &c2);
text_diff(&c1, &c2, pOut, 4, 1);
blob_reset(&c1);
blob_reset(&c2);
if( !isPatch ){
style_header("Diff");
style_submenu_element("Patch", "Patch", "%s/fdiff?v1=%T&v2=%T&patch",
g.zTop, P("v1"), P("v2"));
| > > > > | > | | 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 |
** difference between the two artifacts. Generate plaintext if "patch"
** is present.
*/
void diff_page(void){
int v1, v2;
int isPatch;
Blob c1, c2, diff, *pOut;
char *zV1;
char *zV2;
login_check_credentials();
if( !g.okRead ){ login_needed(); return; }
v1 = name_to_rid_www("v1");
v2 = name_to_rid_www("v2");
if( v1==0 || v2==0 ) fossil_redirect_home();
zV1 = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", v1);
zV2 = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", v2);
isPatch = P("patch")!=0;
if( isPatch ){
pOut = cgi_output_blob();
cgi_set_content_type("text/plain");
}else{
blob_zero(&diff);
pOut = &diff;
}
content_get(v1, &c1);
content_get(v2, &c2);
text_diff(&c1, &c2, pOut, 4, 1);
blob_reset(&c1);
blob_reset(&c2);
if( !isPatch ){
style_header("Diff");
style_submenu_element("Patch", "Patch", "%s/fdiff?v1=%T&v2=%T&patch",
g.zTop, P("v1"), P("v2"));
@ <h2>Differences From
@ Artifact <a href="%s(g.zTop)/artifact/%S(zV1)">[%S(zV1)]</a>:</h2>
@ <blockquote><p>
object_description(v1, 1, 0);
@ </p></blockquote>
@ <h2>To Artifact <a href="%s(g.zTop)/artifact/%S(zV2)">[%S(zV2)]</a>:</h2>
@ <blockquote><p>
object_description(v2, 1, 0);
@ </p></blockquote>
@ <hr />
@ <blockquote><pre>
@ %h(blob_str(&diff))
@ </pre></blockquote>
|
| ︙ | ︙ |