Fossil SCM
Compare repositories by file in "fossil purge checkins -R", so that a repository named through a symbolic link or in another letter case is still recognized as the one the current check-out belongs to.
Commit
7124a42cff1e7b74adb11bf4929e7516f0330f0151223a3e74a4198510fee823
Parent
10bdbac2ef0d01f…
1 file changed
+5
-6
+5
-6
| --- src/purge.c | ||
| +++ src/purge.c | ||
| @@ -610,16 +610,15 @@ | ||
| 610 | 610 | /* Find the current check-out, if there is one in this directory for |
| 611 | 611 | ** this repository, even when the repository was named with -R. */ |
| 612 | 612 | vid = 0; |
| 613 | 613 | if( g.localOpen ){ |
| 614 | 614 | vid = db_lget_int("checkout",0); |
| 615 | - }else if( db_open_local(0) ){ | |
| 616 | - char *zRepo = file_canonical_name_dup(g.zRepositoryName); | |
| 617 | - if( fossil_strcmp(zRepo, db_repository_filename())==0 ){ | |
| 618 | - vid = db_lget_int("checkout",0); | |
| 619 | - } | |
| 620 | - fossil_free(zRepo); | |
| 615 | + }else if( db_open_local(0) | |
| 616 | + && db_exists("SELECT 1 WHERE inode(%Q)=inode(%Q)", | |
| 617 | + g.zRepositoryName, db_repository_filename()) | |
| 618 | + ){ | |
| 619 | + vid = db_lget_int("checkout",0); | |
| 621 | 620 | } |
| 622 | 621 | db_begin_transaction(); |
| 623 | 622 | if( g.argc<=3 ) usage("checkins TAGS... [OPTIONS]"); |
| 624 | 623 | db_multi_exec("CREATE TEMP TABLE ok(rid INTEGER PRIMARY KEY)"); |
| 625 | 624 | for(i=3; i<g.argc; i++){ |
| 626 | 625 |
| --- src/purge.c | |
| +++ src/purge.c | |
| @@ -610,16 +610,15 @@ | |
| 610 | /* Find the current check-out, if there is one in this directory for |
| 611 | ** this repository, even when the repository was named with -R. */ |
| 612 | vid = 0; |
| 613 | if( g.localOpen ){ |
| 614 | vid = db_lget_int("checkout",0); |
| 615 | }else if( db_open_local(0) ){ |
| 616 | char *zRepo = file_canonical_name_dup(g.zRepositoryName); |
| 617 | if( fossil_strcmp(zRepo, db_repository_filename())==0 ){ |
| 618 | vid = db_lget_int("checkout",0); |
| 619 | } |
| 620 | fossil_free(zRepo); |
| 621 | } |
| 622 | db_begin_transaction(); |
| 623 | if( g.argc<=3 ) usage("checkins TAGS... [OPTIONS]"); |
| 624 | db_multi_exec("CREATE TEMP TABLE ok(rid INTEGER PRIMARY KEY)"); |
| 625 | for(i=3; i<g.argc; i++){ |
| 626 |
| --- src/purge.c | |
| +++ src/purge.c | |
| @@ -610,16 +610,15 @@ | |
| 610 | /* Find the current check-out, if there is one in this directory for |
| 611 | ** this repository, even when the repository was named with -R. */ |
| 612 | vid = 0; |
| 613 | if( g.localOpen ){ |
| 614 | vid = db_lget_int("checkout",0); |
| 615 | }else if( db_open_local(0) |
| 616 | && db_exists("SELECT 1 WHERE inode(%Q)=inode(%Q)", |
| 617 | g.zRepositoryName, db_repository_filename()) |
| 618 | ){ |
| 619 | vid = db_lget_int("checkout",0); |
| 620 | } |
| 621 | db_begin_transaction(); |
| 622 | if( g.argc<=3 ) usage("checkins TAGS... [OPTIONS]"); |
| 623 | db_multi_exec("CREATE TEMP TABLE ok(rid INTEGER PRIMARY KEY)"); |
| 624 | for(i=3; i<g.argc; i++){ |
| 625 |