Fossil

Check-in [458b35a507]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Remember the URLs for Git-mirror syncs. Show them on the /urllist page.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 458b35a50717c1b663d90033b21bf9b56c4354044ffb22aca19d59fb51b48356
User & Date: drh 2021-08-14 22:06:42.425
Context
2021-08-15
00:43
Improve the /urllist page so that it shows all servers with which the repository has synced. check-in: 89e5c03a32 user: drh tags: trunk
2021-08-14
22:06
Remember the URLs for Git-mirror syncs. Show them on the /urllist page. check-in: 458b35a507 user: drh tags: trunk
18:25
Further improvements to "fossil all git status" output. Do not show repositories for which the git export repository does not exist or is inactive. check-in: 999d838de2 user: drh tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/export.c.
1712
1713
1714
1715
1716
1717
1718





1719
1720
1721
1722
1723
1724
1725
    }
    gitmirror_message(VERB_NORMAL, "%s\n", zPushCmd);
    fossil_free(zPushCmd);
    zPushCmd = mprintf("git push --mirror %$", zPushUrl);
    rc = fossil_system(zPushCmd);
    if( rc ){
      fossil_fatal("cannot push content using: %s", zPushCmd);





    }
    fossil_free(zPushCmd);
  }
}

/*
** Implementation of the "fossil git status" command.







>
>
>
>
>







1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
    }
    gitmirror_message(VERB_NORMAL, "%s\n", zPushCmd);
    fossil_free(zPushCmd);
    zPushCmd = mprintf("git push --mirror %$", zPushUrl);
    rc = fossil_system(zPushCmd);
    if( rc ){
      fossil_fatal("cannot push content using: %s", zPushCmd);
    }else if( db_is_writeable("repository") ){
      db_unprotect(PROTECT_CONFIG);
      db_multi_exec("REPLACE INTO config(name,value,mtime)"
                    "VALUES('gitpush:%q',1,now())", zPushUrl);
      db_protect_pop();
    }
    fossil_free(zPushCmd);
  }
}

/*
** Implementation of the "fossil git status" command.
Changes to src/stat.c.
479
480
481
482
483
484
485

486
487
488
489
490
491
492
void urllist_page(void){
  Stmt q;
  int cnt;
  int showAll = P("all")!=0;
  int nOmitted;
  sqlite3_int64 iNow;
  char *zRemote;

  login_check_credentials();
  if( !g.perm.Admin ){ login_needed(0); return; }

  style_set_current_feature("stat");
  style_header("URLs and Checkouts");
  style_adunit_config(ADUNIT_RIGHT_OK);
  style_submenu_element("Stat", "stat");







>







479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
void urllist_page(void){
  Stmt q;
  int cnt;
  int showAll = P("all")!=0;
  int nOmitted;
  sqlite3_int64 iNow;
  char *zRemote;

  login_check_credentials();
  if( !g.perm.Admin ){ login_needed(0); return; }

  style_set_current_feature("stat");
  style_header("URLs and Checkouts");
  style_adunit_config(ADUNIT_RIGHT_OK);
  style_submenu_element("Stat", "stat");
538
539
540
541
542
543
544


















545
546
547
548
549
550
551
552
    if( sqlite3_strlike("http%", zRemote, 0)==0 ){
      UrlData x;
      url_parse_local(zRemote, URL_OMIT_USER, &x);
      @ <p><a href='%h(x.canonical)'>%h(zRemote)</a>
    }else{
      @ <p>%h(zRemote)</p>
    }


















    @ </div>
  }
  style_finish_page();
}

/*
** WEBPAGE: repo_schema
**







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|







539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
    if( sqlite3_strlike("http%", zRemote, 0)==0 ){
      UrlData x;
      url_parse_local(zRemote, URL_OMIT_USER, &x);
      @ <p><a href='%h(x.canonical)'>%h(zRemote)</a>
    }else{
      @ <p>%h(zRemote)</p>
    }
  }
  cnt = 0;
  db_prepare(&q, "SELECT substr(name,9), datetime(mtime,'unixepoch')"
                 "  FROM config WHERE name GLOB 'gitpush:*' ORDER BY 2 DESC");
  while( db_step(&q)==SQLITE_ROW ){
    const char *zURL = db_column_text(&q,0);
    UrlData x;
    if( cnt==0 ){
      @ <div class="section">Git Mirrors</div>
      @ <table border='0' width='100%%'>
    }
    url_parse_local(zURL, URL_OMIT_USER, &x);
    @ <tr><td width='100%%'><a href='%h(x.canonical)'>%h(x.canonical)</a>
    @ <td><nobr>%h(db_column_text(&q,1))</nobr></td></tr>
    cnt++;
  }
  db_finalize(&q);
  if( cnt ){
    @ </table>
  }
  style_finish_page();
}

/*
** WEBPAGE: repo_schema
**