Fossil SCM
Fix the "divider" lines in the timeline display. Add the --force option to the "import" command.
Commit
ef68b044493c76887d8cc02ea8a53f111bebae1f
Parent
0e87f42762a0c32…
2 files changed
+2
+4
-4
+2
| --- src/import.c | ||
| +++ src/import.c | ||
| @@ -540,18 +540,20 @@ | ||
| 540 | 540 | ** argument. The get-fast-export text is read from standard input. |
| 541 | 541 | */ |
| 542 | 542 | void git_import_cmd(void){ |
| 543 | 543 | char *zPassword; |
| 544 | 544 | FILE *pIn; |
| 545 | + int forceFlag = find_option("force", "f", 0)!=0; | |
| 545 | 546 | if( g.argc!=3 && g.argc!=4 ){ |
| 546 | 547 | usage("REPOSITORY-NAME"); |
| 547 | 548 | } |
| 548 | 549 | if( g.argc==4 ){ |
| 549 | 550 | pIn = fopen(g.argv[3], "rb"); |
| 550 | 551 | }else{ |
| 551 | 552 | pIn = stdin; |
| 552 | 553 | } |
| 554 | + if( forceFlag ) unlink(g.argv[2]); | |
| 553 | 555 | db_create_repository(g.argv[2]); |
| 554 | 556 | db_open_repository(g.argv[2]); |
| 555 | 557 | db_open_config(0); |
| 556 | 558 | db_multi_exec( |
| 557 | 559 | "ATTACH ':memory:' AS mem1;" |
| 558 | 560 |
| --- 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 @@ | ||
| 617 | 617 | ** "timeline" table to cause <hr> to be inserted before and after |
| 618 | 618 | ** entries of that date. |
| 619 | 619 | */ |
| 620 | 620 | static void timeline_add_dividers(const char *zDate){ |
| 621 | 621 | 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')", | |
| 624 | 624 | zDate |
| 625 | 625 | ); |
| 626 | 626 | 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')", | |
| 629 | 629 | zDate |
| 630 | 630 | ); |
| 631 | 631 | } |
| 632 | 632 | |
| 633 | 633 | |
| 634 | 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,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 |