Fossil SCM

Fix the "divider" lines in the timeline display. Add the --force option to the "import" command.

drh 2010-11-10 13:36 trunk
Commit ef68b044493c76887d8cc02ea8a53f111bebae1f
2 files changed +2 +4 -4
--- src/import.c
+++ src/import.c
@@ -540,18 +540,20 @@
540540
** argument. The get-fast-export text is read from standard input.
541541
*/
542542
void git_import_cmd(void){
543543
char *zPassword;
544544
FILE *pIn;
545
+ int forceFlag = find_option("force", "f", 0)!=0;
545546
if( g.argc!=3 && g.argc!=4 ){
546547
usage("REPOSITORY-NAME");
547548
}
548549
if( g.argc==4 ){
549550
pIn = fopen(g.argv[3], "rb");
550551
}else{
551552
pIn = stdin;
552553
}
554
+ if( forceFlag ) unlink(g.argv[2]);
553555
db_create_repository(g.argv[2]);
554556
db_open_repository(g.argv[2]);
555557
db_open_config(0);
556558
db_multi_exec(
557559
"ATTACH ':memory:' AS mem1;"
558560
--- src/import.c
+++ src/import.c
@@ -540,18 +540,20 @@
540 ** argument. The get-fast-export text is read from standard input.
541 */
542 void git_import_cmd(void){
543 char *zPassword;
544 FILE *pIn;
 
545 if( g.argc!=3 && g.argc!=4 ){
546 usage("REPOSITORY-NAME");
547 }
548 if( g.argc==4 ){
549 pIn = fopen(g.argv[3], "rb");
550 }else{
551 pIn = stdin;
552 }
 
553 db_create_repository(g.argv[2]);
554 db_open_repository(g.argv[2]);
555 db_open_config(0);
556 db_multi_exec(
557 "ATTACH ':memory:' AS mem1;"
558
--- src/import.c
+++ src/import.c
@@ -540,18 +540,20 @@
540 ** argument. The get-fast-export text is read from standard input.
541 */
542 void git_import_cmd(void){
543 char *zPassword;
544 FILE *pIn;
545 int forceFlag = find_option("force", "f", 0)!=0;
546 if( g.argc!=3 && g.argc!=4 ){
547 usage("REPOSITORY-NAME");
548 }
549 if( g.argc==4 ){
550 pIn = fopen(g.argv[3], "rb");
551 }else{
552 pIn = stdin;
553 }
554 if( forceFlag ) unlink(g.argv[2]);
555 db_create_repository(g.argv[2]);
556 db_open_repository(g.argv[2]);
557 db_open_config(0);
558 db_multi_exec(
559 "ATTACH ':memory:' AS mem1;"
560
+4 -4
--- src/timeline.c
+++ src/timeline.c
@@ -617,17 +617,17 @@
617617
** "timeline" table to cause <hr> to be inserted before and after
618618
** entries of that date.
619619
*/
620620
static void timeline_add_dividers(const char *zDate){
621621
db_multi_exec(
622
- "INSERT INTO timeline(rid,timestamp,etype)"
623
- "VALUES(-1,datetime(%Q,'-1 second') || '.9','div')",
622
+ "INSERT INTO timeline(rid,sortby,etype)"
623
+ "VALUES(-1,julianday(%Q,'utc')-5.0e-6,'div')",
624624
zDate
625625
);
626626
db_multi_exec(
627
- "INSERT INTO timeline(rid,timestamp,etype)"
628
- "VALUES(-2,datetime(%Q) || '.1','div')",
627
+ "INSERT INTO timeline(rid,sortby,etype)"
628
+ "VALUES(-2,julianday(%Q,'utc')+5.0e-6,'div')",
629629
zDate
630630
);
631631
}
632632
633633
634634
--- src/timeline.c
+++ src/timeline.c
@@ -617,17 +617,17 @@
617 ** "timeline" table to cause <hr> to be inserted before and after
618 ** entries of that date.
619 */
620 static void timeline_add_dividers(const char *zDate){
621 db_multi_exec(
622 "INSERT INTO timeline(rid,timestamp,etype)"
623 "VALUES(-1,datetime(%Q,'-1 second') || '.9','div')",
624 zDate
625 );
626 db_multi_exec(
627 "INSERT INTO timeline(rid,timestamp,etype)"
628 "VALUES(-2,datetime(%Q) || '.1','div')",
629 zDate
630 );
631 }
632
633
634
--- src/timeline.c
+++ src/timeline.c
@@ -617,17 +617,17 @@
617 ** "timeline" table to cause <hr> to be inserted before and after
618 ** entries of that date.
619 */
620 static void timeline_add_dividers(const char *zDate){
621 db_multi_exec(
622 "INSERT INTO timeline(rid,sortby,etype)"
623 "VALUES(-1,julianday(%Q,'utc')-5.0e-6,'div')",
624 zDate
625 );
626 db_multi_exec(
627 "INSERT INTO timeline(rid,sortby,etype)"
628 "VALUES(-2,julianday(%Q,'utc')+5.0e-6,'div')",
629 zDate
630 );
631 }
632
633
634

Keyboard Shortcuts

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