Fossil SCM

Disable the check of the "server-code" on a sync. This means that two repositories with the same "server-code" can sync with each other, which allows a repository to be copied using an ordinary file copy, and without having to run clone.

drh 2009-10-01 14:47 trunk
Commit 469efd6a7ce8ba441b7c7a558f15e3f7ab5847e4
1 file changed +11 -1
+11 -1
--- src/xfer.c
+++ src/xfer.c
@@ -658,13 +658,21 @@
658658
if( xfer.nToken==3
659659
&& (blob_eq(&xfer.aToken[0], "pull") || blob_eq(&xfer.aToken[0], "push"))
660660
&& blob_is_uuid(&xfer.aToken[1])
661661
&& blob_is_uuid(&xfer.aToken[2])
662662
){
663
- const char *zSCode;
664663
const char *zPCode;
665664
665
+#if 0
666
+ /* This block checks to see if a server is trying to sync with itself.
667
+ ** This used to be disallowed, but I cannot think of any significant
668
+ ** harm, so I have disabled the check.
669
+ **
670
+ ** With this check disabled, it is sufficient to copy the repository
671
+ ** database. No need to run clone.
672
+ */
673
+ const char *zSCode;
666674
zSCode = db_get("server-code", 0);
667675
if( zSCode==0 ){
668676
fossil_panic("missing server code");
669677
}
670678
if( blob_eq_str(&xfer.aToken[1], zSCode, -1) ){
@@ -671,10 +679,12 @@
671679
cgi_reset_content();
672680
@ error server\sloop
673681
nErr++;
674682
break;
675683
}
684
+#endif
685
+
676686
zPCode = db_get("project-code", 0);
677687
if( zPCode==0 ){
678688
fossil_panic("missing project code");
679689
}
680690
if( !blob_eq_str(&xfer.aToken[2], zPCode, -1) ){
681691
--- src/xfer.c
+++ src/xfer.c
@@ -658,13 +658,21 @@
658 if( xfer.nToken==3
659 && (blob_eq(&xfer.aToken[0], "pull") || blob_eq(&xfer.aToken[0], "push"))
660 && blob_is_uuid(&xfer.aToken[1])
661 && blob_is_uuid(&xfer.aToken[2])
662 ){
663 const char *zSCode;
664 const char *zPCode;
665
 
 
 
 
 
 
 
 
 
666 zSCode = db_get("server-code", 0);
667 if( zSCode==0 ){
668 fossil_panic("missing server code");
669 }
670 if( blob_eq_str(&xfer.aToken[1], zSCode, -1) ){
@@ -671,10 +679,12 @@
671 cgi_reset_content();
672 @ error server\sloop
673 nErr++;
674 break;
675 }
 
 
676 zPCode = db_get("project-code", 0);
677 if( zPCode==0 ){
678 fossil_panic("missing project code");
679 }
680 if( !blob_eq_str(&xfer.aToken[2], zPCode, -1) ){
681
--- src/xfer.c
+++ src/xfer.c
@@ -658,13 +658,21 @@
658 if( xfer.nToken==3
659 && (blob_eq(&xfer.aToken[0], "pull") || blob_eq(&xfer.aToken[0], "push"))
660 && blob_is_uuid(&xfer.aToken[1])
661 && blob_is_uuid(&xfer.aToken[2])
662 ){
 
663 const char *zPCode;
664
665 #if 0
666 /* This block checks to see if a server is trying to sync with itself.
667 ** This used to be disallowed, but I cannot think of any significant
668 ** harm, so I have disabled the check.
669 **
670 ** With this check disabled, it is sufficient to copy the repository
671 ** database. No need to run clone.
672 */
673 const char *zSCode;
674 zSCode = db_get("server-code", 0);
675 if( zSCode==0 ){
676 fossil_panic("missing server code");
677 }
678 if( blob_eq_str(&xfer.aToken[1], zSCode, -1) ){
@@ -671,10 +679,12 @@
679 cgi_reset_content();
680 @ error server\sloop
681 nErr++;
682 break;
683 }
684 #endif
685
686 zPCode = db_get("project-code", 0);
687 if( zPCode==0 ){
688 fossil_panic("missing project code");
689 }
690 if( !blob_eq_str(&xfer.aToken[2], zPCode, -1) ){
691

Keyboard Shortcuts

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