Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/merge.py @ 4006:67982d3ee76c
symlinks: add flags param to wwrite
Now wwrite can set symlink and exec for files
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Fri, 29 Dec 2006 20:04:31 -0600 |
parents | 656e06eebda7 |
children | 20da40cc1c73 |
comparison
equal
deleted
inserted
replaced
4005:656e06eebda7 | 4006:67982d3ee76c |
---|---|
344 updated += 1 | 344 updated += 1 |
345 else: | 345 else: |
346 merged += 1 | 346 merged += 1 |
347 if f != fd: | 347 if f != fd: |
348 repo.ui.debug(_("copying %s to %s\n") % (f, fd)) | 348 repo.ui.debug(_("copying %s to %s\n") % (f, fd)) |
349 repo.wwrite(fd, repo.wread(f)) | 349 repo.wwrite(fd, repo.wread(f), flag and 'x' or '') |
350 if move: | 350 if move: |
351 repo.ui.debug(_("removing %s\n") % f) | 351 repo.ui.debug(_("removing %s\n") % f) |
352 os.unlink(repo.wjoin(f)) | 352 os.unlink(repo.wjoin(f)) |
353 util.set_exec(repo.wjoin(fd), flag) | 353 util.set_exec(repo.wjoin(fd), flag) |
354 elif m == "g": # get | 354 elif m == "g": # get |
355 flag = a[2] | 355 flag = a[2] |
356 repo.ui.note(_("getting %s\n") % f) | 356 repo.ui.note(_("getting %s\n") % f) |
357 t = mctx.filectx(f).data() | 357 t = mctx.filectx(f).data() |
358 repo.wwrite(f, t) | 358 repo.wwrite(f, t, flag and 'x' or '') |
359 util.set_exec(repo.wjoin(f), flag) | |
360 updated += 1 | 359 updated += 1 |
361 elif m == "d": # directory rename | 360 elif m == "d": # directory rename |
362 f2, fd, flag = a[2:] | 361 f2, fd, flag = a[2:] |
363 if f: | 362 if f: |
364 repo.ui.note(_("moving %s to %s\n") % (f, fd)) | 363 repo.ui.note(_("moving %s to %s\n") % (f, fd)) |
365 t = wctx.filectx(f).data() | 364 t = wctx.filectx(f).data() |
366 repo.wwrite(fd, t) | 365 repo.wwrite(fd, t, flag and 'x' or '') |
367 util.set_exec(repo.wjoin(fd), flag) | |
368 util.unlink(repo.wjoin(f)) | 366 util.unlink(repo.wjoin(f)) |
369 if f2: | 367 if f2: |
370 repo.ui.note(_("getting %s to %s\n") % (f2, fd)) | 368 repo.ui.note(_("getting %s to %s\n") % (f2, fd)) |
371 t = mctx.filectx(f2).data() | 369 t = mctx.filectx(f2).data() |
372 repo.wwrite(fd, t) | 370 repo.wwrite(fd, t, flag and 'x' or '') |
373 util.set_exec(repo.wjoin(fd), flag) | |
374 updated += 1 | 371 updated += 1 |
375 elif m == "e": # exec | 372 elif m == "e": # exec |
376 flag = a[2] | 373 flag = a[2] |
377 util.set_exec(repo.wjoin(f), flag) | 374 util.set_exec(repo.wjoin(f), flag) |
378 | 375 |