Fossil SCM

No longer display the server-code in info outputs as the server-code is no longer used for anything. Begin recording the location of local checkouts in the ~/.fossil database.

drh 2011-11-04 15:40 trunk
Commit 272e304d3fdbfa35f8122ad53ecb6e1ad556ef4b
+1 -1
--- src/checkin.c
+++ src/checkin.c
@@ -182,15 +182,15 @@
182182
int vid;
183183
db_must_be_within_tree();
184184
/* 012345678901234 */
185185
fossil_print("repository: %s\n", db_lget("repository",""));
186186
fossil_print("local-root: %s\n", g.zLocalRoot);
187
- fossil_print("server-code: %s\n", db_get("server-code", ""));
188187
vid = db_lget_int("checkout", 0);
189188
if( vid ){
190189
show_common_info(vid, "checkout:", 1, 1);
191190
}
191
+ db_record_repository_filename(0);
192192
changes_cmd();
193193
}
194194
195195
/*
196196
** COMMAND: ls
197197
--- src/checkin.c
+++ src/checkin.c
@@ -182,15 +182,15 @@
182 int vid;
183 db_must_be_within_tree();
184 /* 012345678901234 */
185 fossil_print("repository: %s\n", db_lget("repository",""));
186 fossil_print("local-root: %s\n", g.zLocalRoot);
187 fossil_print("server-code: %s\n", db_get("server-code", ""));
188 vid = db_lget_int("checkout", 0);
189 if( vid ){
190 show_common_info(vid, "checkout:", 1, 1);
191 }
 
192 changes_cmd();
193 }
194
195 /*
196 ** COMMAND: ls
197
--- src/checkin.c
+++ src/checkin.c
@@ -182,15 +182,15 @@
182 int vid;
183 db_must_be_within_tree();
184 /* 012345678901234 */
185 fossil_print("repository: %s\n", db_lget("repository",""));
186 fossil_print("local-root: %s\n", g.zLocalRoot);
 
187 vid = db_lget_int("checkout", 0);
188 if( vid ){
189 show_common_info(vid, "checkout:", 1, 1);
190 }
191 db_record_repository_filename(0);
192 changes_cmd();
193 }
194
195 /*
196 ** COMMAND: ls
197
+14
--- src/db.c
+++ src/db.c
@@ -1621,10 +1621,17 @@
16211621
** of the following form:
16221622
**
16231623
** repo:%s
16241624
**
16251625
** The value field is set to 1.
1626
+**
1627
+** If running from a local checkout, also record the root of the checkout
1628
+** as follows:
1629
+**
1630
+** ckout:%s
1631
+**
1632
+** Where %s is the checkout root. The value is the repository file.
16261633
*/
16271634
void db_record_repository_filename(const char *zName){
16281635
Blob full;
16291636
if( zName==0 ){
16301637
if( !g.localOpen ) return;
@@ -1635,10 +1642,17 @@
16351642
db_multi_exec(
16361643
"INSERT OR IGNORE INTO global_config(name,value)"
16371644
"VALUES('repo:%q',1)",
16381645
blob_str(&full)
16391646
);
1647
+ if( g.localOpen && g.zLocalRoot && g.zLocalRoot[0] ){
1648
+ db_multi_exec(
1649
+ "REPLACE INTO global_config(name, value)"
1650
+ "VALUES('ckout:%q','%q');",
1651
+ g.zLocalRoot, blob_str(&full)
1652
+ );
1653
+ }
16401654
db_swap_connections();
16411655
blob_reset(&full);
16421656
}
16431657
16441658
/*
16451659
--- src/db.c
+++ src/db.c
@@ -1621,10 +1621,17 @@
1621 ** of the following form:
1622 **
1623 ** repo:%s
1624 **
1625 ** The value field is set to 1.
 
 
 
 
 
 
 
1626 */
1627 void db_record_repository_filename(const char *zName){
1628 Blob full;
1629 if( zName==0 ){
1630 if( !g.localOpen ) return;
@@ -1635,10 +1642,17 @@
1635 db_multi_exec(
1636 "INSERT OR IGNORE INTO global_config(name,value)"
1637 "VALUES('repo:%q',1)",
1638 blob_str(&full)
1639 );
 
 
 
 
 
 
 
1640 db_swap_connections();
1641 blob_reset(&full);
1642 }
1643
1644 /*
1645
--- src/db.c
+++ src/db.c
@@ -1621,10 +1621,17 @@
1621 ** of the following form:
1622 **
1623 ** repo:%s
1624 **
1625 ** The value field is set to 1.
1626 **
1627 ** If running from a local checkout, also record the root of the checkout
1628 ** as follows:
1629 **
1630 ** ckout:%s
1631 **
1632 ** Where %s is the checkout root. The value is the repository file.
1633 */
1634 void db_record_repository_filename(const char *zName){
1635 Blob full;
1636 if( zName==0 ){
1637 if( !g.localOpen ) return;
@@ -1635,10 +1642,17 @@
1642 db_multi_exec(
1643 "INSERT OR IGNORE INTO global_config(name,value)"
1644 "VALUES('repo:%q',1)",
1645 blob_str(&full)
1646 );
1647 if( g.localOpen && g.zLocalRoot && g.zLocalRoot[0] ){
1648 db_multi_exec(
1649 "REPLACE INTO global_config(name, value)"
1650 "VALUES('ckout:%q','%q');",
1651 g.zLocalRoot, blob_str(&full)
1652 );
1653 }
1654 db_swap_connections();
1655 blob_reset(&full);
1656 }
1657
1658 /*
1659
-2
--- src/info.c
+++ src/info.c
@@ -148,11 +148,10 @@
148148
db_open_config(0);
149149
db_record_repository_filename(g.argv[2]);
150150
db_open_repository(g.argv[2]);
151151
fossil_print("project-name: %s\n", db_get("project-name", "<unnamed>"));
152152
fossil_print("project-code: %s\n", db_get("project-code", "<none>"));
153
- fossil_print("server-code: %s\n", db_get("server-code", "<none>"));
154153
return;
155154
}
156155
db_find_and_open_repository(0,0);
157156
if( g.argc==2 ){
158157
int vid;
@@ -167,11 +166,10 @@
167166
if( g.zHome ){
168167
fossil_print("user-home: %s\n", g.zHome);
169168
}
170169
#endif
171170
fossil_print("project-code: %s\n", db_get("project-code", ""));
172
- fossil_print("server-code: %s\n", db_get("server-code", ""));
173171
vid = g.localOpen ? db_lget_int("checkout", 0) : 0;
174172
if( vid ){
175173
show_common_info(vid, "checkout:", 1, 1);
176174
}
177175
}else{
178176
--- src/info.c
+++ src/info.c
@@ -148,11 +148,10 @@
148 db_open_config(0);
149 db_record_repository_filename(g.argv[2]);
150 db_open_repository(g.argv[2]);
151 fossil_print("project-name: %s\n", db_get("project-name", "<unnamed>"));
152 fossil_print("project-code: %s\n", db_get("project-code", "<none>"));
153 fossil_print("server-code: %s\n", db_get("server-code", "<none>"));
154 return;
155 }
156 db_find_and_open_repository(0,0);
157 if( g.argc==2 ){
158 int vid;
@@ -167,11 +166,10 @@
167 if( g.zHome ){
168 fossil_print("user-home: %s\n", g.zHome);
169 }
170 #endif
171 fossil_print("project-code: %s\n", db_get("project-code", ""));
172 fossil_print("server-code: %s\n", db_get("server-code", ""));
173 vid = g.localOpen ? db_lget_int("checkout", 0) : 0;
174 if( vid ){
175 show_common_info(vid, "checkout:", 1, 1);
176 }
177 }else{
178
--- src/info.c
+++ src/info.c
@@ -148,11 +148,10 @@
148 db_open_config(0);
149 db_record_repository_filename(g.argv[2]);
150 db_open_repository(g.argv[2]);
151 fossil_print("project-name: %s\n", db_get("project-name", "<unnamed>"));
152 fossil_print("project-code: %s\n", db_get("project-code", "<none>"));
 
153 return;
154 }
155 db_find_and_open_repository(0,0);
156 if( g.argc==2 ){
157 int vid;
@@ -167,11 +166,10 @@
166 if( g.zHome ){
167 fossil_print("user-home: %s\n", g.zHome);
168 }
169 #endif
170 fossil_print("project-code: %s\n", db_get("project-code", ""));
 
171 vid = g.localOpen ? db_lget_int("checkout", 0) : 0;
172 if( vid ){
173 show_common_info(vid, "checkout:", 1, 1);
174 }
175 }else{
176

Keyboard Shortcuts

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