Fossil SCM
Use relative paths in paths used by fossil gdiff, as suggested by Ron W: [http://lists.fossil-scm.org:8080/pipermail/fossil-users/2015-April/021015.html]
Commit
3ffb6a3e6299e92ffef396673132fa048c9a64c2
Parent
4440dae21237f86…
1 file changed
+7
-3
+7
-3
| --- src/diffcmd.c | ||
| +++ src/diffcmd.c | ||
| @@ -384,13 +384,17 @@ | ||
| 384 | 384 | int isDeleted = db_column_int(&q, 1); |
| 385 | 385 | int isChnged = db_column_int(&q,2); |
| 386 | 386 | int isNew = db_column_int(&q,3); |
| 387 | 387 | int srcid = db_column_int(&q, 4); |
| 388 | 388 | int isLink = db_column_int(&q, 5); |
| 389 | - char *zToFree = mprintf("%s%s", g.zLocalRoot, zPathname); | |
| 390 | - const char *zFullName = zToFree; | |
| 389 | + const char *zFullName; | |
| 391 | 390 | int showDiff = 1; |
| 391 | + Blob fname; | |
| 392 | + | |
| 393 | + blob_zero(&fname); | |
| 394 | + file_relative_name(zPathname, &fname, 1); | |
| 395 | + zFullName = blob_str(&fname); | |
| 392 | 396 | if( isDeleted ){ |
| 393 | 397 | fossil_print("DELETED %s\n", zPathname); |
| 394 | 398 | if( !asNewFile ){ showDiff = 0; zFullName = NULL_DEVICE; } |
| 395 | 399 | }else if( file_access(zFullName, F_OK) ){ |
| 396 | 400 | fossil_print("MISSING %s\n", zPathname); |
| @@ -422,11 +426,11 @@ | ||
| 422 | 426 | diff_print_index(zPathname, diffFlags); |
| 423 | 427 | diff_file(&content, isBin, zFullName, zPathname, zDiffCmd, |
| 424 | 428 | zBinGlob, fIncludeBinary, diffFlags); |
| 425 | 429 | blob_reset(&content); |
| 426 | 430 | } |
| 427 | - free(zToFree); | |
| 431 | + blob_reset(&fname); | |
| 428 | 432 | } |
| 429 | 433 | db_finalize(&q); |
| 430 | 434 | db_end_transaction(1); /* ROLLBACK */ |
| 431 | 435 | } |
| 432 | 436 | |
| 433 | 437 |
| --- src/diffcmd.c | |
| +++ src/diffcmd.c | |
| @@ -384,13 +384,17 @@ | |
| 384 | int isDeleted = db_column_int(&q, 1); |
| 385 | int isChnged = db_column_int(&q,2); |
| 386 | int isNew = db_column_int(&q,3); |
| 387 | int srcid = db_column_int(&q, 4); |
| 388 | int isLink = db_column_int(&q, 5); |
| 389 | char *zToFree = mprintf("%s%s", g.zLocalRoot, zPathname); |
| 390 | const char *zFullName = zToFree; |
| 391 | int showDiff = 1; |
| 392 | if( isDeleted ){ |
| 393 | fossil_print("DELETED %s\n", zPathname); |
| 394 | if( !asNewFile ){ showDiff = 0; zFullName = NULL_DEVICE; } |
| 395 | }else if( file_access(zFullName, F_OK) ){ |
| 396 | fossil_print("MISSING %s\n", zPathname); |
| @@ -422,11 +426,11 @@ | |
| 422 | diff_print_index(zPathname, diffFlags); |
| 423 | diff_file(&content, isBin, zFullName, zPathname, zDiffCmd, |
| 424 | zBinGlob, fIncludeBinary, diffFlags); |
| 425 | blob_reset(&content); |
| 426 | } |
| 427 | free(zToFree); |
| 428 | } |
| 429 | db_finalize(&q); |
| 430 | db_end_transaction(1); /* ROLLBACK */ |
| 431 | } |
| 432 | |
| 433 |
| --- src/diffcmd.c | |
| +++ src/diffcmd.c | |
| @@ -384,13 +384,17 @@ | |
| 384 | int isDeleted = db_column_int(&q, 1); |
| 385 | int isChnged = db_column_int(&q,2); |
| 386 | int isNew = db_column_int(&q,3); |
| 387 | int srcid = db_column_int(&q, 4); |
| 388 | int isLink = db_column_int(&q, 5); |
| 389 | const char *zFullName; |
| 390 | int showDiff = 1; |
| 391 | Blob fname; |
| 392 | |
| 393 | blob_zero(&fname); |
| 394 | file_relative_name(zPathname, &fname, 1); |
| 395 | zFullName = blob_str(&fname); |
| 396 | if( isDeleted ){ |
| 397 | fossil_print("DELETED %s\n", zPathname); |
| 398 | if( !asNewFile ){ showDiff = 0; zFullName = NULL_DEVICE; } |
| 399 | }else if( file_access(zFullName, F_OK) ){ |
| 400 | fossil_print("MISSING %s\n", zPathname); |
| @@ -422,11 +426,11 @@ | |
| 426 | diff_print_index(zPathname, diffFlags); |
| 427 | diff_file(&content, isBin, zFullName, zPathname, zDiffCmd, |
| 428 | zBinGlob, fIncludeBinary, diffFlags); |
| 429 | blob_reset(&content); |
| 430 | } |
| 431 | blob_reset(&fname); |
| 432 | } |
| 433 | db_finalize(&q); |
| 434 | db_end_transaction(1); /* ROLLBACK */ |
| 435 | } |
| 436 | |
| 437 |