Fossil

Changes On Branch autosync-tries
Login

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

Changes In Branch autosync-tries Excluding Merge-Ins

This is equivalent to a diff from 2a17ab66b2 to 715a36c8ec

2014-06-13
03:56
Add setting to control the number of autosync will be tried before returning an error. Default is historical behavior of one autosync in each direction. check-in: 76bc297e96 user: andybradford tags: trunk
2014-06-02
09:39
Fix comment, some formatting. check-in: 74640de96e user: jan.nijtmans tags: trunk
2014-06-01
04:17
Incorporate recent features/fixes. Closed-Leaf check-in: 715a36c8ec user: andybradford tags: autosync-tries
2014-05-31
22:22
Documented the new -empty flag. check-in: 2a17ab66b2 user: stephan tags: trunk
19:37
The 'new' and 'init' commands again create an initial checkin unless the (new) --empty flag is given or (as before) --date-override is used. check-in: 3b66804d3f user: stephan tags: trunk
2014-05-30
14:54
Allow multiple autosync attempts also for the branch and update commands. check-in: 87d323d307 user: andybradford tags: autosync-tries

Changes to src/branch.c.
174
175
176
177
178
179
180
181

182
183
184
185
186
187
188
174
175
176
177
178
179
180

181
182
183
184
185
186
187
188







-
+







  }


  /* Commit */
  db_end_transaction(0);

  /* Do an autosync push, if requested */
  if( !isPrivate ) autosync(SYNC_PUSH);
  if( !isPrivate ) autosync_loop(SYNC_PUSH,db_get_int("autosync-tries", 1));
}

/*
** Prepare a query that will list branches.
**
** If (which<0) then the query pulls only closed branches. If
** (which>0) then the query pulls all (closed and opened)
Changes to src/checkin.c.
1565
1566
1567
1568
1569
1570
1571
1572

1573
1574
1575
1576
1577
1578
1579
1565
1566
1567
1568
1569
1570
1571

1572
1573
1574
1575
1576
1577
1578
1579







-
+







    g.markPrivate = 1;
  }

  /*
  ** Autosync if autosync is enabled and this is not a private check-in.
  */
  if( !g.markPrivate ){
    if( autosync(SYNC_PULL) ){
    if( autosync_loop(SYNC_PULL, db_get_int("autosync-tries", 1)) ){
      prompt_user("continue in spite of sync failure (y/N)? ", &ans);
      cReply = blob_str(&ans)[0];
      if( cReply!='y' && cReply!='Y' ){
        fossil_exit(1);
      }
    }
  }
1950
1951
1952
1953
1954
1955
1956
1957

1958
1959
1960
1961
1962
1950
1951
1952
1953
1954
1955
1956

1957
1958
1959
1960
1961
1962







-
+





  if( dryRunFlag ){
    db_end_transaction(1);
    exit(1);
  }
  db_end_transaction(0);

  if( !g.markPrivate ){
    autosync(SYNC_PUSH|SYNC_PULL);
    autosync_loop(SYNC_PUSH|SYNC_PULL, db_get_int("autosync-tries", 1));
  }
  if( count_nonbranch_children(vid)>1 ){
    fossil_print("**** warning: a fork has occurred *****\n");
  }
}
Changes to src/db.c.
2127
2128
2129
2130
2131
2132
2133

2134
2135
2136
2137
2138
2139
2140
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141







+







struct stControlSettings const ctrlSettings[] = {
  { "access-log",       0,              0, 0, 0, "off"                 },
  { "allow-symlinks",   0,              0, 1, 0, "off"                 },
  { "auto-captcha",     "autocaptcha",  0, 0, 0, "on"                  },
  { "auto-hyperlink",   0,              0, 0, 0, "on",                 },
  { "auto-shun",        0,              0, 0, 0, "on"                  },
  { "autosync",         0,              0, 0, 0, "on"                  },
  { "autosync-tries",   0,              0, 0, 0, ""                    },
  { "binary-glob",      0,             40, 1, 0, ""                    },
  { "clearsign",        0,              0, 0, 0, "off"                 },
#if defined(_WIN32) || defined(__CYGWIN__) || defined(__DARWIN__) || \
    defined(__APPLE__)
  { "case-sensitive",   0,              0, 0, 0, "off"                 },
#else
  { "case-sensitive",   0,              0, 0, 0, "on"                  },
2219
2220
2221
2222
2223
2224
2225





2226
2227
2228
2229
2230
2231
2232
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238







+
+
+
+
+







**                     Default: on
**
**    autosync         If enabled, automatically pull prior to commit
**                     or update and automatically push after commit or
**                     tag or branch creation.  If the value is "pullonly"
**                     then only pull operations occur automatically.
**                     Default: on
**
**    autosync-tries   If autosync is enabled setting this to a value greater
**                     than zero will cause autosync to try no more than this
**                     number of attempts if there is a sync failure.
**                     Default: 1
**
**    binary-glob      The VALUE is a comma or newline-separated list of
**     (versionable)   GLOB patterns that should be treated as binary files
**                     for committing and merging purposes.  Example: *.jpg
**
**    case-sensitive   If TRUE, the files whose names differ only in case
**                     are considered distinct.  If FALSE files whose names
Changes to src/sync.c.
70
71
72
73
74
75
76











77




78
79
80
81
82
83
84
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87

88
89
90
91
92
93
94
95
96
97
98







+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+







    configSync = CONFIGSET_SHUN;
  }
#endif
  if( find_option("verbose","v",0)!=0 ) flags |= SYNC_VERBOSE;
  fossil_print("Autosync:  %s\n", g.url.canonical);
  url_enable_proxy("via proxy: ");
  rc = client_sync(flags, configSync, 0);
  return rc;
}

/*
** This routine will try a number of times to perform autosync with a
** .5 second sleep between attempts; returning the last autosync status.
*/
int autosync_loop(int flags, int nTries){
  int n = 0;
  int rc = 0;
  while( (n==0 || n < nTries) && (rc = autosync(flags) )){
  if( rc ) fossil_warning("Autosync failed");
    if( rc ) fossil_warning("Autosync failed%s",
      ++n < nTries ? ", making another attempt." : ".");
    sqlite3_sleep(500);
  }
  return rc;
}

/*
** This routine processes the command-line argument for push, pull,
** and sync.  If a command-line argument is given, that is the URL
** of a server to sync against.  If no argument is given, use the
Changes to src/update.c.
128
129
130
131
132
133
134
135


136
137
138
139
140
141
142
128
129
130
131
132
133
134

135
136
137
138
139
140
141
142
143







-
+
+







  debugFlag = find_option("debug",0,0)!=0;
  setmtimeFlag = find_option("setmtime",0,0)!=0;
  capture_case_sensitive_option();
  db_must_be_within_tree();
  vid = db_lget_int("checkout", 0);
  user_select();
  if( !dryRunFlag && !internalUpdate ){
    if( autosync(SYNC_PULL + SYNC_VERBOSE*verboseFlag) ){
    if( autosync_loop(SYNC_PULL + SYNC_VERBOSE*verboseFlag, 
                      db_get_int("autosync-tries", 1)) ){
      fossil_fatal("Cannot proceed with update");
    }
  }
  
  /* Create any empty directories now, as well as after the update,
  ** so changes in settings are reflected now */
  if( !dryRunFlag ) ensure_empty_dirs_created();