Fossil SCM
A few general symlink handling fixes, cherrypicked from "winsymlink" branch
Commit
9867a3ec7cf623749b1b949506e261a435b22f9d
Parent
1c708ccc8f52dd9…
2 files changed
+6
-4
+3
-1
+6
-4
| --- src/checkin.c | ||
| +++ src/checkin.c | ||
| @@ -62,11 +62,11 @@ | ||
| 62 | 62 | zName, filename_collation() |
| 63 | 63 | ); |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | db_prepare(&q, |
| 67 | - "SELECT pathname, deleted, chnged, rid, coalesce(origname!=pathname,0)" | |
| 67 | + "SELECT pathname, deleted, chnged, rid, coalesce(origname!=pathname,0), islink" | |
| 68 | 68 | " FROM vfile " |
| 69 | 69 | " WHERE is_selected(id) %s" |
| 70 | 70 | " AND (chnged OR deleted OR rid=0 OR pathname!=origname)" |
| 71 | 71 | " ORDER BY 1 /*scan*/", |
| 72 | 72 | blob_sql_text(&where) |
| @@ -77,10 +77,11 @@ | ||
| 77 | 77 | const char *zDisplayName = zPathname; |
| 78 | 78 | int isDeleted = db_column_int(&q, 1); |
| 79 | 79 | int isChnged = db_column_int(&q,2); |
| 80 | 80 | int isNew = db_column_int(&q,3)==0; |
| 81 | 81 | int isRenamed = db_column_int(&q,4); |
| 82 | + int isLink = db_column_int(&q,5); | |
| 82 | 83 | char *zFullName = mprintf("%s%s", g.zLocalRoot, zPathname); |
| 83 | 84 | if( cwdRelative ){ |
| 84 | 85 | file_relative_name(zFullName, &rewrittenPathname, 0); |
| 85 | 86 | zDisplayName = blob_str(&rewrittenPathname); |
| 86 | 87 | if( zDisplayName[0]=='.' && zDisplayName[1]=='/' ){ |
| @@ -121,11 +122,11 @@ | ||
| 121 | 122 | blob_appendf(report, "SYMLINK %s\n", zDisplayName); |
| 122 | 123 | }else if( isChnged==8 ){ |
| 123 | 124 | blob_appendf(report, "UNEXEC %s\n", zDisplayName); |
| 124 | 125 | }else if( isChnged==9 ){ |
| 125 | 126 | blob_appendf(report, "UNLINK %s\n", zDisplayName); |
| 126 | - }else if( file_contains_merge_marker(zFullName) ){ | |
| 127 | + }else if( !isLink && file_contains_merge_marker(zFullName) ){ | |
| 127 | 128 | blob_appendf(report, "CONFLICT %s\n", zDisplayName); |
| 128 | 129 | }else{ |
| 129 | 130 | blob_appendf(report, "EDITED %s\n", zDisplayName); |
| 130 | 131 | } |
| 131 | 132 | }else if( isRenamed ){ |
| @@ -434,11 +435,11 @@ | ||
| 434 | 435 | " ORDER BY %s", |
| 435 | 436 | vid, timeline_utc(), blob_sql_text(&where), zOrderBy /*safe-for-%s*/ |
| 436 | 437 | ); |
| 437 | 438 | }else{ |
| 438 | 439 | db_prepare(&q, |
| 439 | - "SELECT pathname, deleted, rid, chnged, coalesce(origname!=pathname,0)" | |
| 440 | + "SELECT pathname, deleted, rid, chnged, coalesce(origname!=pathname,0), islink" | |
| 440 | 441 | " FROM vfile %s" |
| 441 | 442 | " ORDER BY %s", blob_sql_text(&where), zOrderBy /*safe-for-%s*/ |
| 442 | 443 | ); |
| 443 | 444 | } |
| 444 | 445 | blob_reset(&where); |
| @@ -446,10 +447,11 @@ | ||
| 446 | 447 | const char *zPathname = db_column_text(&q,0); |
| 447 | 448 | int isDeleted = db_column_int(&q, 1); |
| 448 | 449 | int isNew = db_column_int(&q,2)==0; |
| 449 | 450 | int chnged = db_column_int(&q,3); |
| 450 | 451 | int renamed = db_column_int(&q,4); |
| 452 | + int isLink = db_column_int(&q,5); | |
| 451 | 453 | char *zFullName = mprintf("%s%s", g.zLocalRoot, zPathname); |
| 452 | 454 | const char *type = ""; |
| 453 | 455 | if( verboseFlag ){ |
| 454 | 456 | if( isNew ){ |
| 455 | 457 | type = "ADDED "; |
| @@ -468,11 +470,11 @@ | ||
| 468 | 470 | type = "ADDED_BY_MERGE "; |
| 469 | 471 | }else if( chnged==4 ){ |
| 470 | 472 | type = "UPDATED_BY_INTEGRATE "; |
| 471 | 473 | }else if( chnged==5 ){ |
| 472 | 474 | type = "ADDED_BY_INTEGRATE "; |
| 473 | - }else if( file_contains_merge_marker(zFullName) ){ | |
| 475 | + }else if( !isLink && file_contains_merge_marker(zFullName) ){ | |
| 474 | 476 | type = "CONFLICT "; |
| 475 | 477 | }else{ |
| 476 | 478 | type = "EDITED "; |
| 477 | 479 | } |
| 478 | 480 | }else if( renamed ){ |
| 479 | 481 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -62,11 +62,11 @@ | |
| 62 | zName, filename_collation() |
| 63 | ); |
| 64 | } |
| 65 | |
| 66 | db_prepare(&q, |
| 67 | "SELECT pathname, deleted, chnged, rid, coalesce(origname!=pathname,0)" |
| 68 | " FROM vfile " |
| 69 | " WHERE is_selected(id) %s" |
| 70 | " AND (chnged OR deleted OR rid=0 OR pathname!=origname)" |
| 71 | " ORDER BY 1 /*scan*/", |
| 72 | blob_sql_text(&where) |
| @@ -77,10 +77,11 @@ | |
| 77 | const char *zDisplayName = zPathname; |
| 78 | int isDeleted = db_column_int(&q, 1); |
| 79 | int isChnged = db_column_int(&q,2); |
| 80 | int isNew = db_column_int(&q,3)==0; |
| 81 | int isRenamed = db_column_int(&q,4); |
| 82 | char *zFullName = mprintf("%s%s", g.zLocalRoot, zPathname); |
| 83 | if( cwdRelative ){ |
| 84 | file_relative_name(zFullName, &rewrittenPathname, 0); |
| 85 | zDisplayName = blob_str(&rewrittenPathname); |
| 86 | if( zDisplayName[0]=='.' && zDisplayName[1]=='/' ){ |
| @@ -121,11 +122,11 @@ | |
| 121 | blob_appendf(report, "SYMLINK %s\n", zDisplayName); |
| 122 | }else if( isChnged==8 ){ |
| 123 | blob_appendf(report, "UNEXEC %s\n", zDisplayName); |
| 124 | }else if( isChnged==9 ){ |
| 125 | blob_appendf(report, "UNLINK %s\n", zDisplayName); |
| 126 | }else if( file_contains_merge_marker(zFullName) ){ |
| 127 | blob_appendf(report, "CONFLICT %s\n", zDisplayName); |
| 128 | }else{ |
| 129 | blob_appendf(report, "EDITED %s\n", zDisplayName); |
| 130 | } |
| 131 | }else if( isRenamed ){ |
| @@ -434,11 +435,11 @@ | |
| 434 | " ORDER BY %s", |
| 435 | vid, timeline_utc(), blob_sql_text(&where), zOrderBy /*safe-for-%s*/ |
| 436 | ); |
| 437 | }else{ |
| 438 | db_prepare(&q, |
| 439 | "SELECT pathname, deleted, rid, chnged, coalesce(origname!=pathname,0)" |
| 440 | " FROM vfile %s" |
| 441 | " ORDER BY %s", blob_sql_text(&where), zOrderBy /*safe-for-%s*/ |
| 442 | ); |
| 443 | } |
| 444 | blob_reset(&where); |
| @@ -446,10 +447,11 @@ | |
| 446 | const char *zPathname = db_column_text(&q,0); |
| 447 | int isDeleted = db_column_int(&q, 1); |
| 448 | int isNew = db_column_int(&q,2)==0; |
| 449 | int chnged = db_column_int(&q,3); |
| 450 | int renamed = db_column_int(&q,4); |
| 451 | char *zFullName = mprintf("%s%s", g.zLocalRoot, zPathname); |
| 452 | const char *type = ""; |
| 453 | if( verboseFlag ){ |
| 454 | if( isNew ){ |
| 455 | type = "ADDED "; |
| @@ -468,11 +470,11 @@ | |
| 468 | type = "ADDED_BY_MERGE "; |
| 469 | }else if( chnged==4 ){ |
| 470 | type = "UPDATED_BY_INTEGRATE "; |
| 471 | }else if( chnged==5 ){ |
| 472 | type = "ADDED_BY_INTEGRATE "; |
| 473 | }else if( file_contains_merge_marker(zFullName) ){ |
| 474 | type = "CONFLICT "; |
| 475 | }else{ |
| 476 | type = "EDITED "; |
| 477 | } |
| 478 | }else if( renamed ){ |
| 479 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -62,11 +62,11 @@ | |
| 62 | zName, filename_collation() |
| 63 | ); |
| 64 | } |
| 65 | |
| 66 | db_prepare(&q, |
| 67 | "SELECT pathname, deleted, chnged, rid, coalesce(origname!=pathname,0), islink" |
| 68 | " FROM vfile " |
| 69 | " WHERE is_selected(id) %s" |
| 70 | " AND (chnged OR deleted OR rid=0 OR pathname!=origname)" |
| 71 | " ORDER BY 1 /*scan*/", |
| 72 | blob_sql_text(&where) |
| @@ -77,10 +77,11 @@ | |
| 77 | const char *zDisplayName = zPathname; |
| 78 | int isDeleted = db_column_int(&q, 1); |
| 79 | int isChnged = db_column_int(&q,2); |
| 80 | int isNew = db_column_int(&q,3)==0; |
| 81 | int isRenamed = db_column_int(&q,4); |
| 82 | int isLink = db_column_int(&q,5); |
| 83 | char *zFullName = mprintf("%s%s", g.zLocalRoot, zPathname); |
| 84 | if( cwdRelative ){ |
| 85 | file_relative_name(zFullName, &rewrittenPathname, 0); |
| 86 | zDisplayName = blob_str(&rewrittenPathname); |
| 87 | if( zDisplayName[0]=='.' && zDisplayName[1]=='/' ){ |
| @@ -121,11 +122,11 @@ | |
| 122 | blob_appendf(report, "SYMLINK %s\n", zDisplayName); |
| 123 | }else if( isChnged==8 ){ |
| 124 | blob_appendf(report, "UNEXEC %s\n", zDisplayName); |
| 125 | }else if( isChnged==9 ){ |
| 126 | blob_appendf(report, "UNLINK %s\n", zDisplayName); |
| 127 | }else if( !isLink && file_contains_merge_marker(zFullName) ){ |
| 128 | blob_appendf(report, "CONFLICT %s\n", zDisplayName); |
| 129 | }else{ |
| 130 | blob_appendf(report, "EDITED %s\n", zDisplayName); |
| 131 | } |
| 132 | }else if( isRenamed ){ |
| @@ -434,11 +435,11 @@ | |
| 435 | " ORDER BY %s", |
| 436 | vid, timeline_utc(), blob_sql_text(&where), zOrderBy /*safe-for-%s*/ |
| 437 | ); |
| 438 | }else{ |
| 439 | db_prepare(&q, |
| 440 | "SELECT pathname, deleted, rid, chnged, coalesce(origname!=pathname,0), islink" |
| 441 | " FROM vfile %s" |
| 442 | " ORDER BY %s", blob_sql_text(&where), zOrderBy /*safe-for-%s*/ |
| 443 | ); |
| 444 | } |
| 445 | blob_reset(&where); |
| @@ -446,10 +447,11 @@ | |
| 447 | const char *zPathname = db_column_text(&q,0); |
| 448 | int isDeleted = db_column_int(&q, 1); |
| 449 | int isNew = db_column_int(&q,2)==0; |
| 450 | int chnged = db_column_int(&q,3); |
| 451 | int renamed = db_column_int(&q,4); |
| 452 | int isLink = db_column_int(&q,5); |
| 453 | char *zFullName = mprintf("%s%s", g.zLocalRoot, zPathname); |
| 454 | const char *type = ""; |
| 455 | if( verboseFlag ){ |
| 456 | if( isNew ){ |
| 457 | type = "ADDED "; |
| @@ -468,11 +470,11 @@ | |
| 470 | type = "ADDED_BY_MERGE "; |
| 471 | }else if( chnged==4 ){ |
| 472 | type = "UPDATED_BY_INTEGRATE "; |
| 473 | }else if( chnged==5 ){ |
| 474 | type = "ADDED_BY_INTEGRATE "; |
| 475 | }else if( !isLink && file_contains_merge_marker(zFullName) ){ |
| 476 | type = "CONFLICT "; |
| 477 | }else{ |
| 478 | type = "EDITED "; |
| 479 | } |
| 480 | }else if( renamed ){ |
| 481 |
+3
-1
| --- src/winfile.c | ||
| +++ src/winfile.c | ||
| @@ -240,11 +240,13 @@ | ||
| 240 | 240 | * Unable to perform access check. |
| 241 | 241 | */ |
| 242 | 242 | |
| 243 | 243 | rc = -1; goto done; |
| 244 | 244 | } |
| 245 | - if( !accessYesNo ) rc = -1; | |
| 245 | + if( !accessYesNo ){ | |
| 246 | + rc = -1; | |
| 247 | + } | |
| 246 | 248 | |
| 247 | 249 | done: |
| 248 | 250 | |
| 249 | 251 | if( hToken != NULL ){ |
| 250 | 252 | CloseHandle(hToken); |
| 251 | 253 |
| --- src/winfile.c | |
| +++ src/winfile.c | |
| @@ -240,11 +240,13 @@ | |
| 240 | * Unable to perform access check. |
| 241 | */ |
| 242 | |
| 243 | rc = -1; goto done; |
| 244 | } |
| 245 | if( !accessYesNo ) rc = -1; |
| 246 | |
| 247 | done: |
| 248 | |
| 249 | if( hToken != NULL ){ |
| 250 | CloseHandle(hToken); |
| 251 |
| --- src/winfile.c | |
| +++ src/winfile.c | |
| @@ -240,11 +240,13 @@ | |
| 240 | * Unable to perform access check. |
| 241 | */ |
| 242 | |
| 243 | rc = -1; goto done; |
| 244 | } |
| 245 | if( !accessYesNo ){ |
| 246 | rc = -1; |
| 247 | } |
| 248 | |
| 249 | done: |
| 250 | |
| 251 | if( hToken != NULL ){ |
| 252 | CloseHandle(hToken); |
| 253 |