Mercurial > hg
comparison hgext/record.py @ 9467:4c041f1ee1b4
do not attempt to translate ui.debug output
author | Martin Geisler <mg@lazybytes.net> |
---|---|
date | Sat, 19 Sep 2009 01:15:38 +0200 |
parents | 784899697571 |
children | fc493cb90bb1 |
comparison
equal
deleted
inserted
replaced
9466:1214c64c592b | 9467:4c041f1ee1b4 |
---|---|
461 if f not in modified: | 461 if f not in modified: |
462 continue | 462 continue |
463 fd, tmpname = tempfile.mkstemp(prefix=f.replace('/', '_')+'.', | 463 fd, tmpname = tempfile.mkstemp(prefix=f.replace('/', '_')+'.', |
464 dir=backupdir) | 464 dir=backupdir) |
465 os.close(fd) | 465 os.close(fd) |
466 ui.debug(_('backup %r as %r\n') % (f, tmpname)) | 466 ui.debug('backup %r as %r\n' % (f, tmpname)) |
467 util.copyfile(repo.wjoin(f), tmpname) | 467 util.copyfile(repo.wjoin(f), tmpname) |
468 backups[f] = tmpname | 468 backups[f] = tmpname |
469 | 469 |
470 fp = cStringIO.StringIO() | 470 fp = cStringIO.StringIO() |
471 for c in chunks: | 471 for c in chunks: |
479 hg.revert(repo, repo.dirstate.parents()[0], backups.has_key) | 479 hg.revert(repo, repo.dirstate.parents()[0], backups.has_key) |
480 | 480 |
481 # 3b. (apply) | 481 # 3b. (apply) |
482 if dopatch: | 482 if dopatch: |
483 try: | 483 try: |
484 ui.debug(_('applying patch\n')) | 484 ui.debug('applying patch\n') |
485 ui.debug(fp.getvalue()) | 485 ui.debug(fp.getvalue()) |
486 pfiles = {} | 486 pfiles = {} |
487 patch.internalpatch(fp, ui, 1, repo.root, files=pfiles, | 487 patch.internalpatch(fp, ui, 1, repo.root, files=pfiles, |
488 eolmode=None) | 488 eolmode=None) |
489 patch.updatedir(ui, repo, pfiles) | 489 patch.updatedir(ui, repo, pfiles) |
510 return 0 | 510 return 0 |
511 finally: | 511 finally: |
512 # 5. finally restore backed-up files | 512 # 5. finally restore backed-up files |
513 try: | 513 try: |
514 for realname, tmpname in backups.iteritems(): | 514 for realname, tmpname in backups.iteritems(): |
515 ui.debug(_('restoring %r to %r\n') % (tmpname, realname)) | 515 ui.debug('restoring %r to %r\n' % (tmpname, realname)) |
516 util.copyfile(tmpname, repo.wjoin(realname)) | 516 util.copyfile(tmpname, repo.wjoin(realname)) |
517 os.unlink(tmpname) | 517 os.unlink(tmpname) |
518 os.rmdir(backupdir) | 518 os.rmdir(backupdir) |
519 except OSError: | 519 except OSError: |
520 pass | 520 pass |