Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| Comment: | Fix problems with update and merge when case-sensitive is off and two different checkouts each add files that differ only in case. |
|---|---|
| Downloads: | Tarball | ZIP archive |
| Timelines: | family | ancestors | descendants | both | trunk |
| Files: | files | file ages | folders |
| SHA1: |
a5a8d0477ad69aaebf14e8c2f6bb8e04 |
| User & Date: | drh 2013-05-23 22:36:34.878 |
Context
|
2013-05-24
| ||
| 07:01 | "fossil update" operates on the local filesystem, so it should have the --case-sensitive option. check-in: 13c7c61ada user: jan.nijtmans tags: trunk | |
|
2013-05-23
| ||
| 22:36 | Fix problems with update and merge when case-sensitive is off and two different checkouts each add files that differ only in case. check-in: a5a8d0477a user: drh tags: trunk | |
| 10:13 | After a sync, report "Sync finished" in stead of "Pull finished" check-in: 97040d6436 user: jan.nijtmans tags: trunk | |
Changes
Changes to src/merge.c.
| ︙ | ︙ | |||
276 277 278 279 280 281 282 |
** The vfile.pathname field is used to match files against each other. The
** FV table contains one row for each each unique filename in
** in the current checkout, the pivot, and the version being merged.
*/
db_multi_exec(
"DROP TABLE IF EXISTS fv;"
"CREATE TEMP TABLE fv("
| | | | | | 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 |
** The vfile.pathname field is used to match files against each other. The
** FV table contains one row for each each unique filename in
** in the current checkout, the pivot, and the version being merged.
*/
db_multi_exec(
"DROP TABLE IF EXISTS fv;"
"CREATE TEMP TABLE fv("
" fn TEXT PRIMARY KEY %s," /* The filename */
" idv INTEGER," /* VFILE entry for current version */
" idp INTEGER," /* VFILE entry for the pivot */
" idm INTEGER," /* VFILE entry for version merging in */
" chnged BOOLEAN," /* True if current version has been edited */
" ridv INTEGER," /* Record ID for current version */
" ridp INTEGER," /* Record ID for pivot */
" ridm INTEGER," /* Record ID for merge */
" isexe BOOLEAN," /* Execute permission enabled */
" fnp TEXT %s," /* The filename in the pivot */
" fnm TEXT %s," /* the filename in the merged version */
" islinkv BOOLEAN," /* True if current version is a symlink */
" islinkm BOOLEAN" /* True if merged version in is a symlink */
");",
filename_collation(), filename_collation(), filename_collation()
);
/* Add files found in V
*/
db_multi_exec(
"INSERT OR IGNORE"
" INTO fv(fn,fnp,fnm,idv,idp,idm,ridv,ridp,ridm,isexe,chnged)"
|
| ︙ | ︙ | |||
329 330 331 332 333 334 335 |
/* Add files found in P but not in V
*/
db_multi_exec(
"INSERT OR IGNORE"
" INTO fv(fn,fnp,fnm,idv,idp,idm,ridv,ridp,ridm,isexe,chnged)"
" SELECT pathname, pathname, pathname, 0, 0, 0, 0, 0, 0, isexe, 0 "
" FROM vfile"
| | | | 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 |
/* Add files found in P but not in V
*/
db_multi_exec(
"INSERT OR IGNORE"
" INTO fv(fn,fnp,fnm,idv,idp,idm,ridv,ridp,ridm,isexe,chnged)"
" SELECT pathname, pathname, pathname, 0, 0, 0, 0, 0, 0, isexe, 0 "
" FROM vfile"
" WHERE vid=%d AND pathname %s NOT IN (SELECT fnp FROM fv)",
pid, filename_collation()
);
/*
** Compute name changes from P->M
*/
find_filename_changes(pid, mid, 0, &nChng, &aChng, debugFlag ? "P->M" : 0);
if( nChng ){
|
| ︙ | ︙ | |||
357 358 359 360 361 362 363 |
*/
db_multi_exec(
"INSERT OR IGNORE"
" INTO fv(fn,fnp,fnm,idv,idp,idm,ridv,ridp,ridm,isexe,chnged)"
" SELECT pathname, pathname, pathname, 0, 0, 0, 0, 0, 0, isexe, 0 "
" FROM vfile"
" WHERE vid=%d"
| | | | | | | | | | 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 |
*/
db_multi_exec(
"INSERT OR IGNORE"
" INTO fv(fn,fnp,fnm,idv,idp,idm,ridv,ridp,ridm,isexe,chnged)"
" SELECT pathname, pathname, pathname, 0, 0, 0, 0, 0, 0, isexe, 0 "
" FROM vfile"
" WHERE vid=%d"
" AND pathname %s NOT IN (SELECT fnp FROM fv UNION SELECT fnm FROM fv)",
mid, filename_collation()
);
/*
** Compute the file version ids for P and M.
*/
db_multi_exec(
"UPDATE fv SET"
" idp=coalesce((SELECT id FROM vfile WHERE vid=%d AND fnp=pathname),0),"
" ridp=coalesce((SELECT rid FROM vfile WHERE vid=%d AND fnp=pathname),0),"
" idm=coalesce((SELECT id FROM vfile WHERE vid=%d AND fnm=pathname),0),"
" ridm=coalesce((SELECT rid FROM vfile WHERE vid=%d AND fnm=pathname),0),"
" islinkv=coalesce((SELECT islink FROM vfile"
" WHERE vid=%d AND fnm=pathname),0),"
" islinkm=coalesce((SELECT islink FROM vfile"
" WHERE vid=%d AND fnm=pathname),0)",
pid, pid, mid, mid, vid, mid
);
if( debugFlag ){
db_prepare(&q,
"SELECT rowid, fn, fnp, fnm, chnged, ridv, ridp, ridm, "
" isexe, islinkv, islinkm FROM fv"
|
| ︙ | ︙ |
Changes to src/update.c.
| ︙ | ︙ | |||
211 212 213 214 215 216 217 |
** The record.fn field is used to match files against each other. The
** FV table contains one row for each each unique filename in
** in the current checkout, the pivot, and the version being merged.
*/
db_multi_exec(
"DROP TABLE IF EXISTS fv;"
"CREATE TEMP TABLE fv("
| | | | > | 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 |
** The record.fn field is used to match files against each other. The
** FV table contains one row for each each unique filename in
** in the current checkout, the pivot, and the version being merged.
*/
db_multi_exec(
"DROP TABLE IF EXISTS fv;"
"CREATE TEMP TABLE fv("
" fn TEXT %s PRIMARY KEY," /* The filename relative to root */
" idv INTEGER," /* VFILE entry for current version */
" idt INTEGER," /* VFILE entry for target version */
" chnged BOOLEAN," /* True if current version has been edited */
" islinkv BOOLEAN," /* True if current file is a link */
" islinkt BOOLEAN," /* True if target file is a link */
" ridv INTEGER," /* Record ID for current version */
" ridt INTEGER," /* Record ID for target */
" isexe BOOLEAN," /* Does target have execute permission? */
" deleted BOOLEAN DEFAULT 0,"/* File marke by "rm" to become unmanaged */
" fnt TEXT %s" /* Filename of same file on target version */
");",
filename_collation(), filename_collation()
);
/* Add files found in the current version
*/
db_multi_exec(
"INSERT OR IGNORE INTO fv(fn,fnt,idv,idt,ridv,ridt,isexe,chnged,deleted)"
" SELECT pathname, pathname, id, 0, rid, 0, isexe, chnged, deleted"
|
| ︙ | ︙ | |||
257 258 259 260 261 262 263 |
/* Add files found in the target version T but missing from the current
** version V.
*/
db_multi_exec(
"INSERT OR IGNORE INTO fv(fn,fnt,idv,idt,ridv,ridt,isexe,chnged)"
" SELECT pathname, pathname, 0, 0, 0, 0, isexe, 0 FROM vfile"
" WHERE vid=%d"
| | | | | | | | 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 |
/* Add files found in the target version T but missing from the current
** version V.
*/
db_multi_exec(
"INSERT OR IGNORE INTO fv(fn,fnt,idv,idt,ridv,ridt,isexe,chnged)"
" SELECT pathname, pathname, 0, 0, 0, 0, isexe, 0 FROM vfile"
" WHERE vid=%d"
" AND pathname %s NOT IN (SELECT fnt FROM fv)",
tid, filename_collation()
);
/*
** Compute the file version ids for T
*/
db_multi_exec(
"UPDATE fv SET"
" idt=coalesce((SELECT id FROM vfile WHERE vid=%d AND fnt=pathname),0),"
" ridt=coalesce((SELECT rid FROM vfile WHERE vid=%d AND fnt=pathname),0)",
tid, tid
);
/*
** Add islink information
*/
db_multi_exec(
"UPDATE fv SET"
" islinkv=coalesce((SELECT islink FROM vfile"
" WHERE vid=%d AND fnt=pathname),0),"
" islinkt=coalesce((SELECT islink FROM vfile"
" WHERE vid=%d AND fnt=pathname),0)",
vid, tid
);
if( debugFlag ){
db_prepare(&q,
"SELECT rowid, fn, fnt, chnged, ridv, ridt, isexe,"
|
| ︙ | ︙ |