1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
|
gitmirror_message(VERB_NORMAL, "%s\n", zPushCmd);
fossil_free(zPushCmd);
zPushCmd = mprintf("git push --mirror %s", zPushUrl);
fossil_system(zPushCmd);
fossil_free(zPushCmd);
}
}
/*
** COMMAND: git
**
** Usage: %fossil git SUBCOMMAND
**
** Do incremental import or export operations between Fossil and Git.
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
|
gitmirror_message(VERB_NORMAL, "%s\n", zPushCmd);
fossil_free(zPushCmd);
zPushCmd = mprintf("git push --mirror %s", zPushUrl);
fossil_system(zPushCmd);
fossil_free(zPushCmd);
}
}
/*
** Implementation of the "fossil git status" command.
**
** Show the status of a "git export".
*/
void gitmirror_status_command(void){
char *zMirror;
char *z;
db_find_and_open_repository(0, 0);
verify_all_options();
zMirror = db_get("last-git-export-repo", 0);
if( zMirror==0 ){
fossil_print("Git mirror: none\n");
return;
}
fossil_print("Git mirror: %s\n", zMirror);
db_multi_exec("ATTACH '%q/.mirror_state/db' AS mirror;", zMirror);
z = db_text(0, "SELECT datetime(value) FROM mconfig WHERE key='start'");
if( z ){
fossil_print("Last export: %s\n", z);
}
z = db_text(0, "SELECT value FROM mconfig WHERE key='autopush'");
if( z==0 ){
fossil_print("Autopush: off\n");
}else{
UrlData url;
url_parse_local(z, 0, &url);
fossil_print("Autopush: %s\n", url.canonical);
}
}
/*
** COMMAND: git
**
** Usage: %fossil git SUBCOMMAND
**
** Do incremental import or export operations between Fossil and Git.
|
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
|
** Useful for debugging
** --quiet|-q Reduce output. Repeat for even less output.
** --verbose|-v More output.
**
** fossil git import MIRROR
**
** TBD...
*/
void gitmirror_command(void){
char *zCmd;
int nCmd;
if( g.argc<3 ){
usage("export ARGS...");
}
zCmd = g.argv[2];
nCmd = (int)strlen(zCmd);
if( nCmd>2 && strncmp(zCmd,"export",nCmd)==0 ){
gitmirror_export_command();
}else
if( nCmd>2 && strncmp(zCmd,"import",nCmd)==0 ){
fossil_fatal("not yet implemented - check back later");
}else
{
fossil_fatal("unknown subcommand \"%s\": should be one of "
"\"export\", \"import\"",
zCmd);
}
}
|
>
>
>
>
>
>
>
|
|
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
|
** Useful for debugging
** --quiet|-q Reduce output. Repeat for even less output.
** --verbose|-v More output.
**
** fossil git import MIRROR
**
** TBD...
**
** fossil git status
**
** Show the status of the current Git mirror, if there is one.
*/
void gitmirror_command(void){
char *zCmd;
int nCmd;
if( g.argc<3 ){
usage("export ARGS...");
}
zCmd = g.argv[2];
nCmd = (int)strlen(zCmd);
if( nCmd>2 && strncmp(zCmd,"export",nCmd)==0 ){
gitmirror_export_command();
}else
if( nCmd>2 && strncmp(zCmd,"import",nCmd)==0 ){
fossil_fatal("not yet implemented - check back later");
}else
if( nCmd>2 && strncmp(zCmd,"status",nCmd)==0 ){
gitmirror_status_command();
}else
{
fossil_fatal("unknown subcommand \"%s\": should be one of "
"\"export\", \"import\", \"status\"",
zCmd);
}
}
|