Show More
@@ -1644,8 +1644,8 b' def config(ui, repo, *values, **opts):' | |||||
1644 | samplehgrc = uimod.samplehgrcs['user'] |
|
1644 | samplehgrc = uimod.samplehgrcs['user'] | |
1645 |
|
1645 | |||
1646 | f = paths[0] |
|
1646 | f = paths[0] | |
1647 | fp = open(f, "w") |
|
1647 | fp = open(f, "wb") | |
1648 | fp.write(samplehgrc) |
|
1648 | fp.write(util.tonativeeol(samplehgrc)) | |
1649 | fp.close() |
|
1649 | fp.close() | |
1650 |
|
1650 | |||
1651 | editor = ui.geteditor() |
|
1651 | editor = ui.geteditor() |
@@ -641,11 +641,11 b' def clone(ui, peeropts, source, dest=Non' | |||||
641 | destrepo = destpeer.local() |
|
641 | destrepo = destpeer.local() | |
642 | if destrepo: |
|
642 | if destrepo: | |
643 | template = uimod.samplehgrcs['cloned'] |
|
643 | template = uimod.samplehgrcs['cloned'] | |
644 |
fp = destrepo.vfs("hgrc", "w" |
|
644 | fp = destrepo.vfs("hgrc", "wb") | |
645 | u = util.url(abspath) |
|
645 | u = util.url(abspath) | |
646 | u.passwd = None |
|
646 | u.passwd = None | |
647 |
defaulturl = |
|
647 | defaulturl = bytes(u) | |
648 | fp.write(template % defaulturl) |
|
648 | fp.write(util.tonativeeol(template % defaulturl)) | |
649 | fp.close() |
|
649 | fp.close() | |
650 |
|
650 | |||
651 | destrepo.ui.setconfig('paths', 'default', defaulturl, 'clone') |
|
651 | destrepo.ui.setconfig('paths', 'default', defaulturl, 'clone') |
@@ -60,7 +60,7 b' git = 1' | |||||
60 |
|
60 | |||
61 | samplehgrcs = { |
|
61 | samplehgrcs = { | |
62 | 'user': |
|
62 | 'user': | |
63 | """# example user config (see 'hg help config' for more info) |
|
63 | b"""# example user config (see 'hg help config' for more info) | |
64 | [ui] |
|
64 | [ui] | |
65 | # name and email, e.g. |
|
65 | # name and email, e.g. | |
66 | # username = Jane Doe <jdoe@example.com> |
|
66 | # username = Jane Doe <jdoe@example.com> | |
@@ -82,7 +82,7 b' username =' | |||||
82 | """, |
|
82 | """, | |
83 |
|
83 | |||
84 | 'cloned': |
|
84 | 'cloned': | |
85 | """# example repository config (see 'hg help config' for more info) |
|
85 | b"""# example repository config (see 'hg help config' for more info) | |
86 | [paths] |
|
86 | [paths] | |
87 | default = %s |
|
87 | default = %s | |
88 |
|
88 | |||
@@ -99,7 +99,7 b' default = %s' | |||||
99 | """, |
|
99 | """, | |
100 |
|
100 | |||
101 | 'local': |
|
101 | 'local': | |
102 | """# example repository config (see 'hg help config' for more info) |
|
102 | b"""# example repository config (see 'hg help config' for more info) | |
103 | [paths] |
|
103 | [paths] | |
104 | # path aliases to other clones of this repo in URLs or filesystem paths |
|
104 | # path aliases to other clones of this repo in URLs or filesystem paths | |
105 | # (see 'hg help config.paths' for more info) |
|
105 | # (see 'hg help config.paths' for more info) | |
@@ -115,7 +115,7 b' default = %s' | |||||
115 | """, |
|
115 | """, | |
116 |
|
116 | |||
117 | 'global': |
|
117 | 'global': | |
118 | """# example system-wide hg config (see 'hg help config' for more info) |
|
118 | b"""# example system-wide hg config (see 'hg help config' for more info) | |
119 |
|
119 | |||
120 | [ui] |
|
120 | [ui] | |
121 | # uncomment to disable color in command output |
|
121 | # uncomment to disable color in command output |
General Comments 0
You need to be logged in to leave comments.
Login now