Fossil

Check-in [6791ad11]
Login

Check-in [6791ad11]

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

Overview
Comment:Now that checkout_cmd() can handle the situation that vid==0 ([b725c1cf26]), no longer assume that the initial commit has rid=1: If the initial commit is not empty that will not be true any more.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 6791ad1185f374dc2dd7c028282cd9c69e18abe0
User & Date: jan.nijtmans 2013-11-19 13:09:40
Context
2013-11-19
18:25
Update the built-in SQLite to the version that includes the DELETE with ONEPASS optimization and the enhanced EXPLAIN indentation in the shell. ... (check-in: 0830c352 user: drh tags: trunk)
13:09
Now that checkout_cmd() can handle the situation that vid==0 ([b725c1cf26]), no longer assume that the initial commit has rid=1: If the initial commit is not empty that will not be true any more. ... (check-in: 6791ad11 user: jan.nijtmans tags: trunk)
2013-11-15
12:58
Update custom makefile as well. If fossil is linked with external SQLite library, make sure it is used single-threaded. ... (check-in: 1928cf52 user: jan.nijtmans tags: trunk)
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/db.c.

2001
2002
2003
2004
2005
2006
2007


2008
2009
2010
2011
2012
2013
2014
**
** See also: close
*/
void cmd_open(void){
  int vid;
  int keepFlag;
  int allowNested;


  static char *azNewArgv[] = { 0, "checkout", "--prompt", 0, 0, 0 };

  url_proxy_options();
  keepFlag = find_option("keep",0,0)!=0;
  allowNested = find_option("nested",0,0)!=0;
  if( g.argc!=3 && g.argc!=4 ){
    usage("REPOSITORY-FILENAME ?VERSION?");







>
>







2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
**
** See also: close
*/
void cmd_open(void){
  int vid;
  int keepFlag;
  int allowNested;
  char **oldArgv;
  int oldArgc;
  static char *azNewArgv[] = { 0, "checkout", "--prompt", 0, 0, 0 };

  url_proxy_options();
  keepFlag = find_option("keep",0,0)!=0;
  allowNested = find_option("nested",0,0)!=0;
  if( g.argc!=3 && g.argc!=4 ){
    usage("REPOSITORY-FILENAME ?VERSION?");
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
                   "COMMIT; PRAGMA journal_mode=WAL; BEGIN;",
#endif
                   (char*)0);
  db_delete_on_failure(LOCALDB_NAME);
  db_open_local(0);
  db_lset("repository", g.argv[2]);
  db_record_repository_filename(g.argv[2]);
  vid = db_int(0, "SELECT pid FROM plink y"
                  " WHERE NOT EXISTS(SELECT 1 FROM plink x WHERE x.cid=y.pid)");
  if( vid==0 ){
    db_lset_int("checkout", 1);
  }else{
    char **oldArgv = g.argv;
    int oldArgc = g.argc;
    db_lset_int("checkout", vid);
    azNewArgv[0] = g.argv[0];
    g.argv = azNewArgv;
    g.argc = 3;
    if( oldArgc==4 ){
      azNewArgv[g.argc-1] = oldArgv[3];
    }else{
      azNewArgv[g.argc-1] = db_get("main-branch", "trunk");
    }
    if( keepFlag ){
      azNewArgv[g.argc++] = "--keep";
    }
    checkout_cmd();
    g.argc = 2;
    info_cmd();
  }
}

/*
** Print the value of a setting named zName
*/
static void print_setting(
  const struct stControlSettings *ctrlSetting,







<
<
<
|
<
|
|
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<







2029
2030
2031
2032
2033
2034
2035



2036

2037
2038

2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052

2053
2054
2055
2056
2057
2058
2059
                   "COMMIT; PRAGMA journal_mode=WAL; BEGIN;",
#endif
                   (char*)0);
  db_delete_on_failure(LOCALDB_NAME);
  db_open_local(0);
  db_lset("repository", g.argv[2]);
  db_record_repository_filename(g.argv[2]);



  db_lset_int("checkout", 0);

  oldArgv = g.argv;
  oldArgc = g.argc;

  azNewArgv[0] = g.argv[0];
  g.argv = azNewArgv;
  g.argc = 3;
  if( oldArgc==4 ){
    azNewArgv[g.argc-1] = oldArgv[3];
  }else{
    azNewArgv[g.argc-1] = db_get("main-branch", "trunk");
  }
  if( keepFlag ){
    azNewArgv[g.argc++] = "--keep";
  }
  checkout_cmd();
  g.argc = 2;
  info_cmd();

}

/*
** Print the value of a setting named zName
*/
static void print_setting(
  const struct stControlSettings *ctrlSetting,