Fossil SCM

A few general symlink handling fixes, cherrypicked from "winsymlink" branch

jan.nijtmans 2015-09-04 11:42 trunk
Commit 9867a3ec7cf623749b1b949506e261a435b22f9d
2 files changed +6 -4 +3 -1
+6 -4
--- src/checkin.c
+++ src/checkin.c
@@ -62,11 +62,11 @@
6262
zName, filename_collation()
6363
);
6464
}
6565
6666
db_prepare(&q,
67
- "SELECT pathname, deleted, chnged, rid, coalesce(origname!=pathname,0)"
67
+ "SELECT pathname, deleted, chnged, rid, coalesce(origname!=pathname,0), islink"
6868
" FROM vfile "
6969
" WHERE is_selected(id) %s"
7070
" AND (chnged OR deleted OR rid=0 OR pathname!=origname)"
7171
" ORDER BY 1 /*scan*/",
7272
blob_sql_text(&where)
@@ -77,10 +77,11 @@
7777
const char *zDisplayName = zPathname;
7878
int isDeleted = db_column_int(&q, 1);
7979
int isChnged = db_column_int(&q,2);
8080
int isNew = db_column_int(&q,3)==0;
8181
int isRenamed = db_column_int(&q,4);
82
+ int isLink = db_column_int(&q,5);
8283
char *zFullName = mprintf("%s%s", g.zLocalRoot, zPathname);
8384
if( cwdRelative ){
8485
file_relative_name(zFullName, &rewrittenPathname, 0);
8586
zDisplayName = blob_str(&rewrittenPathname);
8687
if( zDisplayName[0]=='.' && zDisplayName[1]=='/' ){
@@ -121,11 +122,11 @@
121122
blob_appendf(report, "SYMLINK %s\n", zDisplayName);
122123
}else if( isChnged==8 ){
123124
blob_appendf(report, "UNEXEC %s\n", zDisplayName);
124125
}else if( isChnged==9 ){
125126
blob_appendf(report, "UNLINK %s\n", zDisplayName);
126
- }else if( file_contains_merge_marker(zFullName) ){
127
+ }else if( !isLink && file_contains_merge_marker(zFullName) ){
127128
blob_appendf(report, "CONFLICT %s\n", zDisplayName);
128129
}else{
129130
blob_appendf(report, "EDITED %s\n", zDisplayName);
130131
}
131132
}else if( isRenamed ){
@@ -434,11 +435,11 @@
434435
" ORDER BY %s",
435436
vid, timeline_utc(), blob_sql_text(&where), zOrderBy /*safe-for-%s*/
436437
);
437438
}else{
438439
db_prepare(&q,
439
- "SELECT pathname, deleted, rid, chnged, coalesce(origname!=pathname,0)"
440
+ "SELECT pathname, deleted, rid, chnged, coalesce(origname!=pathname,0), islink"
440441
" FROM vfile %s"
441442
" ORDER BY %s", blob_sql_text(&where), zOrderBy /*safe-for-%s*/
442443
);
443444
}
444445
blob_reset(&where);
@@ -446,10 +447,11 @@
446447
const char *zPathname = db_column_text(&q,0);
447448
int isDeleted = db_column_int(&q, 1);
448449
int isNew = db_column_int(&q,2)==0;
449450
int chnged = db_column_int(&q,3);
450451
int renamed = db_column_int(&q,4);
452
+ int isLink = db_column_int(&q,5);
451453
char *zFullName = mprintf("%s%s", g.zLocalRoot, zPathname);
452454
const char *type = "";
453455
if( verboseFlag ){
454456
if( isNew ){
455457
type = "ADDED ";
@@ -468,11 +470,11 @@
468470
type = "ADDED_BY_MERGE ";
469471
}else if( chnged==4 ){
470472
type = "UPDATED_BY_INTEGRATE ";
471473
}else if( chnged==5 ){
472474
type = "ADDED_BY_INTEGRATE ";
473
- }else if( file_contains_merge_marker(zFullName) ){
475
+ }else if( !isLink && file_contains_merge_marker(zFullName) ){
474476
type = "CONFLICT ";
475477
}else{
476478
type = "EDITED ";
477479
}
478480
}else if( renamed ){
479481
--- 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 @@
240240
* Unable to perform access check.
241241
*/
242242
243243
rc = -1; goto done;
244244
}
245
- if( !accessYesNo ) rc = -1;
245
+ if( !accessYesNo ){
246
+ rc = -1;
247
+ }
246248
247249
done:
248250
249251
if( hToken != NULL ){
250252
CloseHandle(hToken);
251253
--- 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

Keyboard Shortcuts

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