Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/commands.py @ 1331:cfae1ed2d61f
Write hgrc file in text mode, even on Windows.
author | Bryan O'Sullivan <bos@serpentine.com> |
---|---|
date | Fri, 23 Sep 2005 10:31:00 -0700 |
parents | 57220daf40e9 |
children | d4b25df77a9e |
comparison
equal
deleted
inserted
replaced
1330:0fcde73dc3ca | 1331:cfae1ed2d61f |
---|---|
622 copy = False | 622 copy = False |
623 if other.dev() != -1: | 623 if other.dev() != -1: |
624 abspath = os.path.abspath(source) | 624 abspath = os.path.abspath(source) |
625 if not opts['pull']: | 625 if not opts['pull']: |
626 copy = True | 626 copy = True |
627 | 627 |
628 if copy: | 628 if copy: |
629 try: | 629 try: |
630 # we use a lock here because if we race with commit, we | 630 # we use a lock here because if we race with commit, we |
631 # can end up with extra data in the cloned revlogs that's | 631 # can end up with extra data in the cloned revlogs that's |
632 # not pointed to by changesets, thus causing verify to | 632 # not pointed to by changesets, thus causing verify to |
650 | 650 |
651 else: | 651 else: |
652 repo = hg.repository(ui, dest, create=1) | 652 repo = hg.repository(ui, dest, create=1) |
653 repo.pull(other) | 653 repo.pull(other) |
654 | 654 |
655 f = repo.opener("hgrc", "w") | 655 f = repo.opener("hgrc", "w", text=True) |
656 f.write("[paths]\n") | 656 f.write("[paths]\n") |
657 f.write("default = %s\n" % abspath) | 657 f.write("default = %s\n" % abspath) |
658 | 658 |
659 if not opts['noupdate']: | 659 if not opts['noupdate']: |
660 update(ui, repo) | 660 update(ui, repo) |