Fossil

Check-in [071de8f1]
Login

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

Overview
Comment:Added /json/rebuild. Is likely to fail w/ an AJAX timeout for large repos, which will probably cause the rebuild to roll back on the next open :/. Takes 21sec on my 32-bit netbook to rebuild the fossil repo.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | json
Files: files | file ages | folders
SHA1:071de8f1bd5b84540b78c6ac0b0f9e7073c86a79
User & Date: stephan 2011-09-29 15:23:30
Context
2011-09-29
17:03
minor jsonp tweaks. Added some test code for it in the demo app, but there is still some jsonp disconnect between the two AJAJ layers, and i may need to consolidate them to work around it. check-in: f48b687a user: stephan tags: json
15:23
Added /json/rebuild. Is likely to fail w/ an AJAX timeout for large repos, which will probably cause the rebuild to roll back on the next open :/. Takes 21sec on my 32-bit netbook to rebuild the fossil repo. check-in: 071de8f1 user: stephan tags: json
13:08
Removed a test/debug #if block which i accidentally left enabled in [73e28dd718]. check-in: 5ddfe3d6 user: stephan tags: json
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/json.c.

1671
1672
1673
1674
1675
1676
1677






















1678
1679
1680
1681
1682
1683
1684
....
1759
1760
1761
1762
1763
1764
1765

1766
1767
1768
1769
1770
1771
1772
      json_warn(FSL_JSON_W_COL_TO_JSON_FAILED,msg);
      free(msg);
    }
  }
  return payV;
}
























/*
** Impl of /json/user/list. Requires admin rights.
*/
static cson_value * json_user_list(){
  cson_value * payV = NULL;
  Stmt q;
................................................................................
{"anonymousPassword",json_page_anon_password, 1},
{"branch", json_page_branch,0},
{"cap", json_page_cap, 0},
{"dir", json_page_nyi, 0},
{"HAI",json_page_version,0},
{"login",json_page_login,1},
{"logout",json_page_logout,1},

{"stat",json_page_stat,0},
{"tag", json_page_nyi,0},
{"ticket", json_page_nyi,0},
{"timeline", json_page_timeline,0},
{"user",json_page_user,0},
{"version",json_page_version,0},
{"whoami",json_page_whoami,1/*FIXME: work in CLI mode*/},







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







>







1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
....
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
      json_warn(FSL_JSON_W_COL_TO_JSON_FAILED,msg);
      free(msg);
    }
  }
  return payV;
}

/*
** Impl of /json/rebuild. Requires admin previleges.
*/
static cson_value * json_page_rebuild(){
if( !g.perm.Admin ){
    g.json.resultCode = FSL_JSON_E_DENIED;
    return NULL;
  }else{
  /* Reminder: the db_xxx() ops "should" fail via
     the fossil core error handlers, which will cause
     a JSON error and exit(). i.e. we don't handle
     the errors here. TODO: confirm that all these
     db routine fail gracefully in JSON mode.
  */
    db_close(1);
    db_open_repository(g.zRepositoryName);
    db_begin_transaction();
    rebuild_db(0, 0, 0);
    db_end_transaction(0);
    return NULL;
  }
}

/*
** Impl of /json/user/list. Requires admin rights.
*/
static cson_value * json_user_list(){
  cson_value * payV = NULL;
  Stmt q;
................................................................................
{"anonymousPassword",json_page_anon_password, 1},
{"branch", json_page_branch,0},
{"cap", json_page_cap, 0},
{"dir", json_page_nyi, 0},
{"HAI",json_page_version,0},
{"login",json_page_login,1},
{"logout",json_page_logout,1},
{"rebuild",json_page_rebuild,0},
{"stat",json_page_stat,0},
{"tag", json_page_nyi,0},
{"ticket", json_page_nyi,0},
{"timeline", json_page_timeline,0},
{"user",json_page_user,0},
{"version",json_page_version,0},
{"whoami",json_page_whoami,1/*FIXME: work in CLI mode*/},