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.

dmestas 2026-11-17 13:49 UTC small-fixes-2
Commit 7124a42cff1e7b74adb11bf4929e7516f0330f0151223a3e74a4198510fee823
1 file changed +5 -6
+5 -6
--- src/purge.c
+++ src/purge.c
@@ -610,16 +610,15 @@
610610
/* Find the current check-out, if there is one in this directory for
611611
** this repository, even when the repository was named with -R. */
612612
vid = 0;
613613
if( g.localOpen ){
614614
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);
621620
}
622621
db_begin_transaction();
623622
if( g.argc<=3 ) usage("checkins TAGS... [OPTIONS]");
624623
db_multi_exec("CREATE TEMP TABLE ok(rid INTEGER PRIMARY KEY)");
625624
for(i=3; i<g.argc; i++){
626625
--- 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

Keyboard Shortcuts

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