Fossil SCM
Added the "all" command for things like "fossil all sync". I am not sure "all" is quite the right name for this command, so I may yet change it.
Commit
9346f2290c84084f4641a48a5e0fc813d1587251
Parent
4ef19b554a19b74…
7 files changed
+5
+4
-1
+23
-1
+13
-3
+1
+2
+3
+5
| --- a/src/allrepo.c | ||
| +++ b/src/allrepo.c | ||
| @@ -0,0 +1,5 @@ | ||
| 1 | +/*extras | |
| 2 | +if( useChecprepaionis file is located inDDATA% | |
| 3 | +** or %HOMGNU General "SELECT substr(name, 6) FROM hows|lsddsyncsyncsync-R %s -autourl", | |
| 4 | + finalize} | |
| 5 | +onst |
| --- a/src/allrepo.c | |
| +++ b/src/allrepo.c | |
| @@ -0,0 +1,5 @@ | |
| --- a/src/allrepo.c | |
| +++ b/src/allrepo.c | |
| @@ -0,0 +1,5 @@ | |
| 1 | /*extras |
| 2 | if( useChecprepaionis file is located inDDATA% |
| 3 | ** or %HOMGNU General "SELECT substr(name, 6) FROM hows|lsddsyncsyncsync-R %s -autourl", |
| 4 | finalize} |
| 5 | onst |
+4
-1
| --- src/checkin.c | ||
| +++ src/checkin.c | ||
| @@ -46,11 +46,13 @@ | ||
| 46 | 46 | int isDeleted = db_column_int(&q, 1); |
| 47 | 47 | int isChnged = db_column_int(&q,2); |
| 48 | 48 | int isNew = db_column_int(&q,3)==0; |
| 49 | 49 | char *zFullName = mprintf("%s/%s", g.zLocalRoot, zPathname); |
| 50 | 50 | blob_append(report, zPrefix, nPrefix); |
| 51 | - if( access(zFullName, 0) ){ | |
| 51 | + if( isDeleted ){ | |
| 52 | + blob_appendf(report, "DELETED %s\n", zPathname); | |
| 53 | + }else if( access(zFullName, 0) ){ | |
| 52 | 54 | blob_appendf(report, "MISSING %s\n", zPathname); |
| 53 | 55 | }else if( isNew ){ |
| 54 | 56 | blob_appendf(report, "ADDED %s\n", zPathname); |
| 55 | 57 | }else if( isDeleted ){ |
| 56 | 58 | blob_appendf(report, "DELETED %s\n", zPathname); |
| @@ -398,10 +400,11 @@ | ||
| 398 | 400 | if( !db_exists("SELECT 1 FROM user WHERE login=%Q", g.zLogin) ){ |
| 399 | 401 | fossil_fatal("no such user: %s", g.zLogin); |
| 400 | 402 | } |
| 401 | 403 | |
| 402 | 404 | db_begin_transaction(); |
| 405 | + db_record_repository_filename(0); | |
| 403 | 406 | rc = unsaved_changes(); |
| 404 | 407 | if( rc==0 && !isAMerge && !forceFlag ){ |
| 405 | 408 | fossil_panic("nothing has changed"); |
| 406 | 409 | } |
| 407 | 410 | |
| 408 | 411 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -46,11 +46,13 @@ | |
| 46 | int isDeleted = db_column_int(&q, 1); |
| 47 | int isChnged = db_column_int(&q,2); |
| 48 | int isNew = db_column_int(&q,3)==0; |
| 49 | char *zFullName = mprintf("%s/%s", g.zLocalRoot, zPathname); |
| 50 | blob_append(report, zPrefix, nPrefix); |
| 51 | if( access(zFullName, 0) ){ |
| 52 | blob_appendf(report, "MISSING %s\n", zPathname); |
| 53 | }else if( isNew ){ |
| 54 | blob_appendf(report, "ADDED %s\n", zPathname); |
| 55 | }else if( isDeleted ){ |
| 56 | blob_appendf(report, "DELETED %s\n", zPathname); |
| @@ -398,10 +400,11 @@ | |
| 398 | if( !db_exists("SELECT 1 FROM user WHERE login=%Q", g.zLogin) ){ |
| 399 | fossil_fatal("no such user: %s", g.zLogin); |
| 400 | } |
| 401 | |
| 402 | db_begin_transaction(); |
| 403 | rc = unsaved_changes(); |
| 404 | if( rc==0 && !isAMerge && !forceFlag ){ |
| 405 | fossil_panic("nothing has changed"); |
| 406 | } |
| 407 | |
| 408 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -46,11 +46,13 @@ | |
| 46 | int isDeleted = db_column_int(&q, 1); |
| 47 | int isChnged = db_column_int(&q,2); |
| 48 | int isNew = db_column_int(&q,3)==0; |
| 49 | char *zFullName = mprintf("%s/%s", g.zLocalRoot, zPathname); |
| 50 | blob_append(report, zPrefix, nPrefix); |
| 51 | if( isDeleted ){ |
| 52 | blob_appendf(report, "DELETED %s\n", zPathname); |
| 53 | }else if( access(zFullName, 0) ){ |
| 54 | blob_appendf(report, "MISSING %s\n", zPathname); |
| 55 | }else if( isNew ){ |
| 56 | blob_appendf(report, "ADDED %s\n", zPathname); |
| 57 | }else if( isDeleted ){ |
| 58 | blob_appendf(report, "DELETED %s\n", zPathname); |
| @@ -398,10 +400,11 @@ | |
| 400 | if( !db_exists("SELECT 1 FROM user WHERE login=%Q", g.zLogin) ){ |
| 401 | fossil_fatal("no such user: %s", g.zLogin); |
| 402 | } |
| 403 | |
| 404 | db_begin_transaction(); |
| 405 | db_record_repository_filename(0); |
| 406 | rc = unsaved_changes(); |
| 407 | if( rc==0 && !isAMerge && !forceFlag ){ |
| 408 | fossil_panic("nothing has changed"); |
| 409 | } |
| 410 | |
| 411 |
M
src/db.c
+23
-1
| --- src/db.c | ||
| +++ src/db.c | ||
| @@ -555,10 +555,11 @@ | ||
| 555 | 555 | ** it does not already exist. |
| 556 | 556 | */ |
| 557 | 557 | void db_open_config(void){ |
| 558 | 558 | char *zDbName; |
| 559 | 559 | const char *zHome; |
| 560 | + if( g.configOpen ) return; | |
| 560 | 561 | #ifdef __MINGW32__ |
| 561 | 562 | zHome = getenv("LOCALAPPDATA"); |
| 562 | 563 | if( zHome==0 ){ |
| 563 | 564 | zHome = getenv("APPDATA"); |
| 564 | 565 | if( zHome==0 ){ |
| @@ -575,11 +576,10 @@ | ||
| 575 | 576 | /* . filenames give some window systems problems and many apps problems */ |
| 576 | 577 | zDbName = mprintf("%//_fossil", zHome); |
| 577 | 578 | #else |
| 578 | 579 | zDbName = mprintf("%s/.fossil", zHome); |
| 579 | 580 | #endif |
| 580 | - if( g.configOpen ) return; | |
| 581 | 581 | if( file_size(zDbName)<1024*3 ){ |
| 582 | 582 | db_init_database(zDbName, zConfigSchema, (char*)0); |
| 583 | 583 | } |
| 584 | 584 | db_open_or_attach(zDbName, "configdb"); |
| 585 | 585 | g.configOpen = 1; |
| @@ -1118,10 +1118,31 @@ | ||
| 1118 | 1118 | return db_int(dflt, "SELECT value FROM vvar WHERE name=%Q", zName); |
| 1119 | 1119 | } |
| 1120 | 1120 | void db_lset_int(const char *zName, int value){ |
| 1121 | 1121 | db_multi_exec("REPLACE INTO vvar(name,value) VALUES(%Q,%d)", zName, value); |
| 1122 | 1122 | } |
| 1123 | + | |
| 1124 | +/* | |
| 1125 | +** Record the name of a local repository in the global_config() database. | |
| 1126 | +** The repostiroy filename %s is recorded as an entry with a "name" field | |
| 1127 | +** of the following form: | |
| 1128 | +** | |
| 1129 | +** repo:%s | |
| 1130 | +** | |
| 1131 | +** The value field is set to 1. | |
| 1132 | +*/ | |
| 1133 | +void db_record_repository_filename(const char *zName){ | |
| 1134 | + if( zName==0 ){ | |
| 1135 | + if( !g.localOpen ) return; | |
| 1136 | + zName = db_lget("repository", 0); | |
| 1137 | + } | |
| 1138 | + db_multi_exec( | |
| 1139 | + "INSERT OR IGNORE INTO global_config(name,value)" | |
| 1140 | + "VALUES('repo:%q',1)", | |
| 1141 | + zName | |
| 1142 | + ); | |
| 1143 | +} | |
| 1123 | 1144 | |
| 1124 | 1145 | /* |
| 1125 | 1146 | ** COMMAND: open |
| 1126 | 1147 | ** |
| 1127 | 1148 | ** Usage: open FILENAME |
| @@ -1144,10 +1165,11 @@ | ||
| 1144 | 1165 | file_canonical_name(g.argv[2], &path); |
| 1145 | 1166 | db_open_repository(blob_str(&path)); |
| 1146 | 1167 | db_init_database("./_FOSSIL_", zLocalSchema, (char*)0); |
| 1147 | 1168 | db_open_local(); |
| 1148 | 1169 | db_lset("repository", blob_str(&path)); |
| 1170 | + db_record_repository_filename(blob_str(&path)); | |
| 1149 | 1171 | vid = db_int(0, "SELECT pid FROM plink y" |
| 1150 | 1172 | " WHERE NOT EXISTS(SELECT 1 FROM plink x WHERE x.cid=y.pid)"); |
| 1151 | 1173 | if( vid==0 ){ |
| 1152 | 1174 | db_lset_int("checkout", 1); |
| 1153 | 1175 | }else{ |
| 1154 | 1176 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -555,10 +555,11 @@ | |
| 555 | ** it does not already exist. |
| 556 | */ |
| 557 | void db_open_config(void){ |
| 558 | char *zDbName; |
| 559 | const char *zHome; |
| 560 | #ifdef __MINGW32__ |
| 561 | zHome = getenv("LOCALAPPDATA"); |
| 562 | if( zHome==0 ){ |
| 563 | zHome = getenv("APPDATA"); |
| 564 | if( zHome==0 ){ |
| @@ -575,11 +576,10 @@ | |
| 575 | /* . filenames give some window systems problems and many apps problems */ |
| 576 | zDbName = mprintf("%//_fossil", zHome); |
| 577 | #else |
| 578 | zDbName = mprintf("%s/.fossil", zHome); |
| 579 | #endif |
| 580 | if( g.configOpen ) return; |
| 581 | if( file_size(zDbName)<1024*3 ){ |
| 582 | db_init_database(zDbName, zConfigSchema, (char*)0); |
| 583 | } |
| 584 | db_open_or_attach(zDbName, "configdb"); |
| 585 | g.configOpen = 1; |
| @@ -1118,10 +1118,31 @@ | |
| 1118 | return db_int(dflt, "SELECT value FROM vvar WHERE name=%Q", zName); |
| 1119 | } |
| 1120 | void db_lset_int(const char *zName, int value){ |
| 1121 | db_multi_exec("REPLACE INTO vvar(name,value) VALUES(%Q,%d)", zName, value); |
| 1122 | } |
| 1123 | |
| 1124 | /* |
| 1125 | ** COMMAND: open |
| 1126 | ** |
| 1127 | ** Usage: open FILENAME |
| @@ -1144,10 +1165,11 @@ | |
| 1144 | file_canonical_name(g.argv[2], &path); |
| 1145 | db_open_repository(blob_str(&path)); |
| 1146 | db_init_database("./_FOSSIL_", zLocalSchema, (char*)0); |
| 1147 | db_open_local(); |
| 1148 | db_lset("repository", blob_str(&path)); |
| 1149 | vid = db_int(0, "SELECT pid FROM plink y" |
| 1150 | " WHERE NOT EXISTS(SELECT 1 FROM plink x WHERE x.cid=y.pid)"); |
| 1151 | if( vid==0 ){ |
| 1152 | db_lset_int("checkout", 1); |
| 1153 | }else{ |
| 1154 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -555,10 +555,11 @@ | |
| 555 | ** it does not already exist. |
| 556 | */ |
| 557 | void db_open_config(void){ |
| 558 | char *zDbName; |
| 559 | const char *zHome; |
| 560 | if( g.configOpen ) return; |
| 561 | #ifdef __MINGW32__ |
| 562 | zHome = getenv("LOCALAPPDATA"); |
| 563 | if( zHome==0 ){ |
| 564 | zHome = getenv("APPDATA"); |
| 565 | if( zHome==0 ){ |
| @@ -575,11 +576,10 @@ | |
| 576 | /* . filenames give some window systems problems and many apps problems */ |
| 577 | zDbName = mprintf("%//_fossil", zHome); |
| 578 | #else |
| 579 | zDbName = mprintf("%s/.fossil", zHome); |
| 580 | #endif |
| 581 | if( file_size(zDbName)<1024*3 ){ |
| 582 | db_init_database(zDbName, zConfigSchema, (char*)0); |
| 583 | } |
| 584 | db_open_or_attach(zDbName, "configdb"); |
| 585 | g.configOpen = 1; |
| @@ -1118,10 +1118,31 @@ | |
| 1118 | return db_int(dflt, "SELECT value FROM vvar WHERE name=%Q", zName); |
| 1119 | } |
| 1120 | void db_lset_int(const char *zName, int value){ |
| 1121 | db_multi_exec("REPLACE INTO vvar(name,value) VALUES(%Q,%d)", zName, value); |
| 1122 | } |
| 1123 | |
| 1124 | /* |
| 1125 | ** Record the name of a local repository in the global_config() database. |
| 1126 | ** The repostiroy filename %s is recorded as an entry with a "name" field |
| 1127 | ** of the following form: |
| 1128 | ** |
| 1129 | ** repo:%s |
| 1130 | ** |
| 1131 | ** The value field is set to 1. |
| 1132 | */ |
| 1133 | void db_record_repository_filename(const char *zName){ |
| 1134 | if( zName==0 ){ |
| 1135 | if( !g.localOpen ) return; |
| 1136 | zName = db_lget("repository", 0); |
| 1137 | } |
| 1138 | db_multi_exec( |
| 1139 | "INSERT OR IGNORE INTO global_config(name,value)" |
| 1140 | "VALUES('repo:%q',1)", |
| 1141 | zName |
| 1142 | ); |
| 1143 | } |
| 1144 | |
| 1145 | /* |
| 1146 | ** COMMAND: open |
| 1147 | ** |
| 1148 | ** Usage: open FILENAME |
| @@ -1144,10 +1165,11 @@ | |
| 1165 | file_canonical_name(g.argv[2], &path); |
| 1166 | db_open_repository(blob_str(&path)); |
| 1167 | db_init_database("./_FOSSIL_", zLocalSchema, (char*)0); |
| 1168 | db_open_local(); |
| 1169 | db_lset("repository", blob_str(&path)); |
| 1170 | db_record_repository_filename(blob_str(&path)); |
| 1171 | vid = db_int(0, "SELECT pid FROM plink y" |
| 1172 | " WHERE NOT EXISTS(SELECT 1 FROM plink x WHERE x.cid=y.pid)"); |
| 1173 | if( vid==0 ){ |
| 1174 | db_lset_int("checkout", 1); |
| 1175 | }else{ |
| 1176 |
+13
-3
| --- src/main.mk | ||
| +++ src/main.mk | ||
| @@ -13,10 +13,11 @@ | ||
| 13 | 13 | |
| 14 | 14 | |
| 15 | 15 | SRC = \ |
| 16 | 16 | $(SRCDIR)/add.c \ |
| 17 | 17 | $(SRCDIR)/admin.c \ |
| 18 | + $(SRCDIR)/allrepo.c \ | |
| 18 | 19 | $(SRCDIR)/bag.c \ |
| 19 | 20 | $(SRCDIR)/blob.c \ |
| 20 | 21 | $(SRCDIR)/branch.c \ |
| 21 | 22 | $(SRCDIR)/browse.c \ |
| 22 | 23 | $(SRCDIR)/cgi.c \ |
| @@ -79,10 +80,11 @@ | ||
| 79 | 80 | $(SRCDIR)/zip.c |
| 80 | 81 | |
| 81 | 82 | TRANS_SRC = \ |
| 82 | 83 | add_.c \ |
| 83 | 84 | admin_.c \ |
| 85 | + allrepo_.c \ | |
| 84 | 86 | bag_.c \ |
| 85 | 87 | blob_.c \ |
| 86 | 88 | branch_.c \ |
| 87 | 89 | browse_.c \ |
| 88 | 90 | cgi_.c \ |
| @@ -145,10 +147,11 @@ | ||
| 145 | 147 | zip_.c |
| 146 | 148 | |
| 147 | 149 | OBJ = \ |
| 148 | 150 | add.o \ |
| 149 | 151 | admin.o \ |
| 152 | + allrepo.o \ | |
| 150 | 153 | bag.o \ |
| 151 | 154 | blob.o \ |
| 152 | 155 | branch.o \ |
| 153 | 156 | browse.o \ |
| 154 | 157 | cgi.o \ |
| @@ -249,16 +252,16 @@ | ||
| 249 | 252 | # noop |
| 250 | 253 | |
| 251 | 254 | clean: |
| 252 | 255 | rm -f *.o *_.c $(APPNAME) VERSION.h |
| 253 | 256 | rm -f translate makeheaders mkindex page_index.h headers |
| 254 | - rm -f add.h admin.h bag.h blob.h branch.h browse.h cgi.h checkin.h checkout.h clearsign.h clone.h comformat.h configure.h construct.h content.h db.h delta.h deltacmd.h descendants.h diff.h diffcmd.h doc.h encode.h file.h http.h info.h login.h main.h manifest.h md5.h merge.h merge3.h my_page.h name.h pivot.h pqueue.h printf.h rebuild.h report.h rss.h schema.h setup.h sha1.h shun.h stat.h style.h sync.h tag.h tagview.h th_main.h timeline.h tkt.h tktsetup.h undo.h update.h url.h user.h verify.h vfile.h wiki.h wikiformat.h winhttp.h xfer.h zip.h | |
| 257 | + rm -f add.h admin.h allrepo.h bag.h blob.h branch.h browse.h cgi.h checkin.h checkout.h clearsign.h clone.h comformat.h configure.h construct.h content.h db.h delta.h deltacmd.h descendants.h diff.h diffcmd.h doc.h encode.h file.h http.h info.h login.h main.h manifest.h md5.h merge.h merge3.h my_page.h name.h pivot.h pqueue.h printf.h rebuild.h report.h rss.h schema.h setup.h sha1.h shun.h stat.h style.h sync.h tag.h tagview.h th_main.h timeline.h tkt.h tktsetup.h undo.h update.h url.h user.h verify.h vfile.h wiki.h wikiformat.h winhttp.h xfer.h zip.h | |
| 255 | 258 | |
| 256 | 259 | page_index.h: $(TRANS_SRC) mkindex |
| 257 | 260 | ./mkindex $(TRANS_SRC) >$@ |
| 258 | -headers: page_index.h makeheaders $(TRANS_SRC) VERSION.h | |
| 259 | - ./makeheaders add_.c:add.h admin_.c:admin.h bag_.c:bag.h blob_.c:blob.h branch_.c:branch.h browse_.c:browse.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h configure_.c:configure.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendants_.c:descendants.h diff_.c:diff.h diffcmd_.c:diffcmd.h doc_.c:doc.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h my_page_.c:my_page.h name_.c:name.h pivot_.c:pivot.h pqueue_.c:pqueue.h printf_.c:printf.h rebuild_.c:rebuild.h report_.c:report.h rss_.c:rss.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h shun_.c:shun.h stat_.c:stat.h style_.c:style.h sync_.c:sync.h tag_.c:tag.h tagview_.c:tagview.h th_main_.c:th_main.h timeline_.c:timeline.h tkt_.c:tkt.h tktsetup_.c:tktsetup.h undo_.c:undo.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h winhttp_.c:winhttp.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h $(SRCDIR)/th.h VERSION.h | |
| 261 | +headers: page_index.h makeheaders VERSION.h | |
| 262 | + ./makeheaders add_.c:add.h admin_.c:admin.h allrepo_.c:allrepo.h bag_.c:bag.h blob_.c:blob.h branch_.c:branch.h browse_.c:browse.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h configure_.c:configure.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendants_.c:descendants.h diff_.c:diff.h diffcmd_.c:diffcmd.h doc_.c:doc.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h my_page_.c:my_page.h name_.c:name.h pivot_.c:pivot.h pqueue_.c:pqueue.h printf_.c:printf.h rebuild_.c:rebuild.h report_.c:report.h rss_.c:rss.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h shun_.c:shun.h stat_.c:stat.h style_.c:style.h sync_.c:sync.h tag_.c:tag.h tagview_.c:tagview.h th_main_.c:th_main.h timeline_.c:timeline.h tkt_.c:tkt.h tktsetup_.c:tktsetup.h undo_.c:undo.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h winhttp_.c:winhttp.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h $(SRCDIR)/th.h VERSION.h | |
| 260 | 263 | touch headers |
| 261 | 264 | headers: Makefile |
| 262 | 265 | Makefile: |
| 263 | 266 | add_.c: $(SRCDIR)/add.c $(SRCDIR)/VERSION translate |
| 264 | 267 | ./translate $(SRCDIR)/add.c | sed -f $(SRCDIR)/VERSION >add_.c |
| @@ -272,10 +275,17 @@ | ||
| 272 | 275 | |
| 273 | 276 | admin.o: admin_.c admin.h $(SRCDIR)/config.h |
| 274 | 277 | $(XTCC) -o admin.o -c admin_.c |
| 275 | 278 | |
| 276 | 279 | admin.h: headers |
| 280 | +allrepo_.c: $(SRCDIR)/allrepo.c $(SRCDIR)/VERSION translate | |
| 281 | + ./translate $(SRCDIR)/allrepo.c | sed -f $(SRCDIR)/VERSION >allrepo_.c | |
| 282 | + | |
| 283 | +allrepo.o: allrepo_.c allrepo.h $(SRCDIR)/config.h | |
| 284 | + $(XTCC) -o allrepo.o -c allrepo_.c | |
| 285 | + | |
| 286 | +allrepo.h: headers | |
| 277 | 287 | bag_.c: $(SRCDIR)/bag.c $(SRCDIR)/VERSION translate |
| 278 | 288 | ./translate $(SRCDIR)/bag.c | sed -f $(SRCDIR)/VERSION >bag_.c |
| 279 | 289 | |
| 280 | 290 | bag.o: bag_.c bag.h $(SRCDIR)/config.h |
| 281 | 291 | $(XTCC) -o bag.o -c bag_.c |
| 282 | 292 |
| --- src/main.mk | |
| +++ src/main.mk | |
| @@ -13,10 +13,11 @@ | |
| 13 | |
| 14 | |
| 15 | SRC = \ |
| 16 | $(SRCDIR)/add.c \ |
| 17 | $(SRCDIR)/admin.c \ |
| 18 | $(SRCDIR)/bag.c \ |
| 19 | $(SRCDIR)/blob.c \ |
| 20 | $(SRCDIR)/branch.c \ |
| 21 | $(SRCDIR)/browse.c \ |
| 22 | $(SRCDIR)/cgi.c \ |
| @@ -79,10 +80,11 @@ | |
| 79 | $(SRCDIR)/zip.c |
| 80 | |
| 81 | TRANS_SRC = \ |
| 82 | add_.c \ |
| 83 | admin_.c \ |
| 84 | bag_.c \ |
| 85 | blob_.c \ |
| 86 | branch_.c \ |
| 87 | browse_.c \ |
| 88 | cgi_.c \ |
| @@ -145,10 +147,11 @@ | |
| 145 | zip_.c |
| 146 | |
| 147 | OBJ = \ |
| 148 | add.o \ |
| 149 | admin.o \ |
| 150 | bag.o \ |
| 151 | blob.o \ |
| 152 | branch.o \ |
| 153 | browse.o \ |
| 154 | cgi.o \ |
| @@ -249,16 +252,16 @@ | |
| 249 | # noop |
| 250 | |
| 251 | clean: |
| 252 | rm -f *.o *_.c $(APPNAME) VERSION.h |
| 253 | rm -f translate makeheaders mkindex page_index.h headers |
| 254 | rm -f add.h admin.h bag.h blob.h branch.h browse.h cgi.h checkin.h checkout.h clearsign.h clone.h comformat.h configure.h construct.h content.h db.h delta.h deltacmd.h descendants.h diff.h diffcmd.h doc.h encode.h file.h http.h info.h login.h main.h manifest.h md5.h merge.h merge3.h my_page.h name.h pivot.h pqueue.h printf.h rebuild.h report.h rss.h schema.h setup.h sha1.h shun.h stat.h style.h sync.h tag.h tagview.h th_main.h timeline.h tkt.h tktsetup.h undo.h update.h url.h user.h verify.h vfile.h wiki.h wikiformat.h winhttp.h xfer.h zip.h |
| 255 | |
| 256 | page_index.h: $(TRANS_SRC) mkindex |
| 257 | ./mkindex $(TRANS_SRC) >$@ |
| 258 | headers: page_index.h makeheaders $(TRANS_SRC) VERSION.h |
| 259 | ./makeheaders add_.c:add.h admin_.c:admin.h bag_.c:bag.h blob_.c:blob.h branch_.c:branch.h browse_.c:browse.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h configure_.c:configure.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendants_.c:descendants.h diff_.c:diff.h diffcmd_.c:diffcmd.h doc_.c:doc.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h my_page_.c:my_page.h name_.c:name.h pivot_.c:pivot.h pqueue_.c:pqueue.h printf_.c:printf.h rebuild_.c:rebuild.h report_.c:report.h rss_.c:rss.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h shun_.c:shun.h stat_.c:stat.h style_.c:style.h sync_.c:sync.h tag_.c:tag.h tagview_.c:tagview.h th_main_.c:th_main.h timeline_.c:timeline.h tkt_.c:tkt.h tktsetup_.c:tktsetup.h undo_.c:undo.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h winhttp_.c:winhttp.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h $(SRCDIR)/th.h VERSION.h |
| 260 | touch headers |
| 261 | headers: Makefile |
| 262 | Makefile: |
| 263 | add_.c: $(SRCDIR)/add.c $(SRCDIR)/VERSION translate |
| 264 | ./translate $(SRCDIR)/add.c | sed -f $(SRCDIR)/VERSION >add_.c |
| @@ -272,10 +275,17 @@ | |
| 272 | |
| 273 | admin.o: admin_.c admin.h $(SRCDIR)/config.h |
| 274 | $(XTCC) -o admin.o -c admin_.c |
| 275 | |
| 276 | admin.h: headers |
| 277 | bag_.c: $(SRCDIR)/bag.c $(SRCDIR)/VERSION translate |
| 278 | ./translate $(SRCDIR)/bag.c | sed -f $(SRCDIR)/VERSION >bag_.c |
| 279 | |
| 280 | bag.o: bag_.c bag.h $(SRCDIR)/config.h |
| 281 | $(XTCC) -o bag.o -c bag_.c |
| 282 |
| --- src/main.mk | |
| +++ src/main.mk | |
| @@ -13,10 +13,11 @@ | |
| 13 | |
| 14 | |
| 15 | SRC = \ |
| 16 | $(SRCDIR)/add.c \ |
| 17 | $(SRCDIR)/admin.c \ |
| 18 | $(SRCDIR)/allrepo.c \ |
| 19 | $(SRCDIR)/bag.c \ |
| 20 | $(SRCDIR)/blob.c \ |
| 21 | $(SRCDIR)/branch.c \ |
| 22 | $(SRCDIR)/browse.c \ |
| 23 | $(SRCDIR)/cgi.c \ |
| @@ -79,10 +80,11 @@ | |
| 80 | $(SRCDIR)/zip.c |
| 81 | |
| 82 | TRANS_SRC = \ |
| 83 | add_.c \ |
| 84 | admin_.c \ |
| 85 | allrepo_.c \ |
| 86 | bag_.c \ |
| 87 | blob_.c \ |
| 88 | branch_.c \ |
| 89 | browse_.c \ |
| 90 | cgi_.c \ |
| @@ -145,10 +147,11 @@ | |
| 147 | zip_.c |
| 148 | |
| 149 | OBJ = \ |
| 150 | add.o \ |
| 151 | admin.o \ |
| 152 | allrepo.o \ |
| 153 | bag.o \ |
| 154 | blob.o \ |
| 155 | branch.o \ |
| 156 | browse.o \ |
| 157 | cgi.o \ |
| @@ -249,16 +252,16 @@ | |
| 252 | # noop |
| 253 | |
| 254 | clean: |
| 255 | rm -f *.o *_.c $(APPNAME) VERSION.h |
| 256 | rm -f translate makeheaders mkindex page_index.h headers |
| 257 | rm -f add.h admin.h allrepo.h bag.h blob.h branch.h browse.h cgi.h checkin.h checkout.h clearsign.h clone.h comformat.h configure.h construct.h content.h db.h delta.h deltacmd.h descendants.h diff.h diffcmd.h doc.h encode.h file.h http.h info.h login.h main.h manifest.h md5.h merge.h merge3.h my_page.h name.h pivot.h pqueue.h printf.h rebuild.h report.h rss.h schema.h setup.h sha1.h shun.h stat.h style.h sync.h tag.h tagview.h th_main.h timeline.h tkt.h tktsetup.h undo.h update.h url.h user.h verify.h vfile.h wiki.h wikiformat.h winhttp.h xfer.h zip.h |
| 258 | |
| 259 | page_index.h: $(TRANS_SRC) mkindex |
| 260 | ./mkindex $(TRANS_SRC) >$@ |
| 261 | headers: page_index.h makeheaders VERSION.h |
| 262 | ./makeheaders add_.c:add.h admin_.c:admin.h allrepo_.c:allrepo.h bag_.c:bag.h blob_.c:blob.h branch_.c:branch.h browse_.c:browse.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h configure_.c:configure.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendants_.c:descendants.h diff_.c:diff.h diffcmd_.c:diffcmd.h doc_.c:doc.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h my_page_.c:my_page.h name_.c:name.h pivot_.c:pivot.h pqueue_.c:pqueue.h printf_.c:printf.h rebuild_.c:rebuild.h report_.c:report.h rss_.c:rss.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h shun_.c:shun.h stat_.c:stat.h style_.c:style.h sync_.c:sync.h tag_.c:tag.h tagview_.c:tagview.h th_main_.c:th_main.h timeline_.c:timeline.h tkt_.c:tkt.h tktsetup_.c:tktsetup.h undo_.c:undo.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h winhttp_.c:winhttp.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h $(SRCDIR)/th.h VERSION.h |
| 263 | touch headers |
| 264 | headers: Makefile |
| 265 | Makefile: |
| 266 | add_.c: $(SRCDIR)/add.c $(SRCDIR)/VERSION translate |
| 267 | ./translate $(SRCDIR)/add.c | sed -f $(SRCDIR)/VERSION >add_.c |
| @@ -272,10 +275,17 @@ | |
| 275 | |
| 276 | admin.o: admin_.c admin.h $(SRCDIR)/config.h |
| 277 | $(XTCC) -o admin.o -c admin_.c |
| 278 | |
| 279 | admin.h: headers |
| 280 | allrepo_.c: $(SRCDIR)/allrepo.c $(SRCDIR)/VERSION translate |
| 281 | ./translate $(SRCDIR)/allrepo.c | sed -f $(SRCDIR)/VERSION >allrepo_.c |
| 282 | |
| 283 | allrepo.o: allrepo_.c allrepo.h $(SRCDIR)/config.h |
| 284 | $(XTCC) -o allrepo.o -c allrepo_.c |
| 285 | |
| 286 | allrepo.h: headers |
| 287 | bag_.c: $(SRCDIR)/bag.c $(SRCDIR)/VERSION translate |
| 288 | ./translate $(SRCDIR)/bag.c | sed -f $(SRCDIR)/VERSION >bag_.c |
| 289 | |
| 290 | bag.o: bag_.c bag.h $(SRCDIR)/config.h |
| 291 | $(XTCC) -o bag.o -c bag_.c |
| 292 |
+1
| --- src/makemake.tcl | ||
| +++ src/makemake.tcl | ||
| @@ -7,10 +7,11 @@ | ||
| 7 | 7 | # "translate" and "makeheaders" |
| 8 | 8 | # |
| 9 | 9 | set src { |
| 10 | 10 | add |
| 11 | 11 | admin |
| 12 | + allrepo | |
| 12 | 13 | bag |
| 13 | 14 | blob |
| 14 | 15 | branch |
| 15 | 16 | browse |
| 16 | 17 | cgi |
| 17 | 18 |
| --- src/makemake.tcl | |
| +++ src/makemake.tcl | |
| @@ -7,10 +7,11 @@ | |
| 7 | # "translate" and "makeheaders" |
| 8 | # |
| 9 | set src { |
| 10 | add |
| 11 | admin |
| 12 | bag |
| 13 | blob |
| 14 | branch |
| 15 | browse |
| 16 | cgi |
| 17 |
| --- src/makemake.tcl | |
| +++ src/makemake.tcl | |
| @@ -7,10 +7,11 @@ | |
| 7 | # "translate" and "makeheaders" |
| 8 | # |
| 9 | set src { |
| 10 | add |
| 11 | admin |
| 12 | allrepo |
| 13 | bag |
| 14 | blob |
| 15 | branch |
| 16 | browse |
| 17 | cgi |
| 18 |
+2
| --- src/sync.c | ||
| +++ src/sync.c | ||
| @@ -72,18 +72,20 @@ | ||
| 72 | 72 | ** of a server to sync against. If no argument is given, use the |
| 73 | 73 | ** most recently synced URL. Remember the current URL for next time. |
| 74 | 74 | */ |
| 75 | 75 | void process_sync_args(void){ |
| 76 | 76 | const char *zUrl = 0; |
| 77 | + int urlOptional = find_option("autourl",0,0)!=0; | |
| 77 | 78 | url_proxy_options(); |
| 78 | 79 | db_find_and_open_repository(1); |
| 79 | 80 | if( g.argc==2 ){ |
| 80 | 81 | zUrl = db_get("last-sync-url", 0); |
| 81 | 82 | }else if( g.argc==3 ){ |
| 82 | 83 | zUrl = g.argv[2]; |
| 83 | 84 | } |
| 84 | 85 | if( zUrl==0 ){ |
| 86 | + if( urlOptional ) exit(0); | |
| 85 | 87 | usage("URL"); |
| 86 | 88 | } |
| 87 | 89 | url_parse(zUrl); |
| 88 | 90 | if( g.urlIsFile ){ |
| 89 | 91 | fossil_fatal("network sync only"); |
| 90 | 92 |
| --- src/sync.c | |
| +++ src/sync.c | |
| @@ -72,18 +72,20 @@ | |
| 72 | ** of a server to sync against. If no argument is given, use the |
| 73 | ** most recently synced URL. Remember the current URL for next time. |
| 74 | */ |
| 75 | void process_sync_args(void){ |
| 76 | const char *zUrl = 0; |
| 77 | url_proxy_options(); |
| 78 | db_find_and_open_repository(1); |
| 79 | if( g.argc==2 ){ |
| 80 | zUrl = db_get("last-sync-url", 0); |
| 81 | }else if( g.argc==3 ){ |
| 82 | zUrl = g.argv[2]; |
| 83 | } |
| 84 | if( zUrl==0 ){ |
| 85 | usage("URL"); |
| 86 | } |
| 87 | url_parse(zUrl); |
| 88 | if( g.urlIsFile ){ |
| 89 | fossil_fatal("network sync only"); |
| 90 |
| --- src/sync.c | |
| +++ src/sync.c | |
| @@ -72,18 +72,20 @@ | |
| 72 | ** of a server to sync against. If no argument is given, use the |
| 73 | ** most recently synced URL. Remember the current URL for next time. |
| 74 | */ |
| 75 | void process_sync_args(void){ |
| 76 | const char *zUrl = 0; |
| 77 | int urlOptional = find_option("autourl",0,0)!=0; |
| 78 | url_proxy_options(); |
| 79 | db_find_and_open_repository(1); |
| 80 | if( g.argc==2 ){ |
| 81 | zUrl = db_get("last-sync-url", 0); |
| 82 | }else if( g.argc==3 ){ |
| 83 | zUrl = g.argv[2]; |
| 84 | } |
| 85 | if( zUrl==0 ){ |
| 86 | if( urlOptional ) exit(0); |
| 87 | usage("URL"); |
| 88 | } |
| 89 | url_parse(zUrl); |
| 90 | if( g.urlIsFile ){ |
| 91 | fossil_fatal("network sync only"); |
| 92 |
+3
| --- src/xfer.c | ||
| +++ src/xfer.c | ||
| @@ -818,10 +818,13 @@ | ||
| 818 | 818 | |
| 819 | 819 | assert( pushFlag || pullFlag || cloneFlag || configMask ); |
| 820 | 820 | assert( !g.urlIsFile ); /* This only works for networking */ |
| 821 | 821 | |
| 822 | 822 | db_begin_transaction(); |
| 823 | + if( pullFlag || cloneFlag ){ | |
| 824 | + db_record_repository_filename(0); | |
| 825 | + } | |
| 823 | 826 | db_multi_exec( |
| 824 | 827 | "CREATE TEMP TABLE onremote(rid INTEGER PRIMARY KEY);" |
| 825 | 828 | ); |
| 826 | 829 | blobarray_zero(xfer.aToken, count(xfer.aToken)); |
| 827 | 830 | blob_zero(&send); |
| 828 | 831 |
| --- src/xfer.c | |
| +++ src/xfer.c | |
| @@ -818,10 +818,13 @@ | |
| 818 | |
| 819 | assert( pushFlag || pullFlag || cloneFlag || configMask ); |
| 820 | assert( !g.urlIsFile ); /* This only works for networking */ |
| 821 | |
| 822 | db_begin_transaction(); |
| 823 | db_multi_exec( |
| 824 | "CREATE TEMP TABLE onremote(rid INTEGER PRIMARY KEY);" |
| 825 | ); |
| 826 | blobarray_zero(xfer.aToken, count(xfer.aToken)); |
| 827 | blob_zero(&send); |
| 828 |
| --- src/xfer.c | |
| +++ src/xfer.c | |
| @@ -818,10 +818,13 @@ | |
| 818 | |
| 819 | assert( pushFlag || pullFlag || cloneFlag || configMask ); |
| 820 | assert( !g.urlIsFile ); /* This only works for networking */ |
| 821 | |
| 822 | db_begin_transaction(); |
| 823 | if( pullFlag || cloneFlag ){ |
| 824 | db_record_repository_filename(0); |
| 825 | } |
| 826 | db_multi_exec( |
| 827 | "CREATE TEMP TABLE onremote(rid INTEGER PRIMARY KEY);" |
| 828 | ); |
| 829 | blobarray_zero(xfer.aToken, count(xfer.aToken)); |
| 830 | blob_zero(&send); |
| 831 |