Show More
@@ -432,12 +432,23 b' def clone(ui, peeropts, source, dest=Non' | |||||
432 | destpeer.pushkey('bookmarks', k, '', hex(n)) |
|
432 | destpeer.pushkey('bookmarks', k, '', hex(n)) | |
433 |
|
433 | |||
434 | if destrepo: |
|
434 | if destrepo: | |
|
435 | template = ( | |||
|
436 | '# You may want to set your username here if it is not set\n' | |||
|
437 | "# globally, or this repository requires a different\n" | |||
|
438 | '# username from your usual configuration. If you want to\n' | |||
|
439 | '# set something for all of your repositories on this\n' | |||
|
440 | '# computer, try running the command\n' | |||
|
441 | "# 'hg config --edit --global'\n" | |||
|
442 | '# [ui]\n' | |||
|
443 | '# username = Jane Doe <jdoe@example.com>\n' | |||
|
444 | '[paths]\n' | |||
|
445 | 'default = %s\n' | |||
|
446 | ) | |||
435 | fp = destrepo.opener("hgrc", "w", text=True) |
|
447 | fp = destrepo.opener("hgrc", "w", text=True) | |
436 | fp.write("[paths]\n") |
|
|||
437 | u = util.url(abspath) |
|
448 | u = util.url(abspath) | |
438 | u.passwd = None |
|
449 | u.passwd = None | |
439 | defaulturl = str(u) |
|
450 | defaulturl = str(u) | |
440 |
fp.write( |
|
451 | fp.write(template % defaulturl) | |
441 | fp.close() |
|
452 | fp.close() | |
442 |
|
453 | |||
443 | destrepo.ui.setconfig('paths', 'default', defaulturl, 'clone') |
|
454 | destrepo.ui.setconfig('paths', 'default', defaulturl, 'clone') |
@@ -28,6 +28,14 b" Issue1199: Can't use '%' in hgrc (eg url" | |||||
28 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
28 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
29 | $ cd foobar |
|
29 | $ cd foobar | |
30 | $ cat .hg/hgrc |
|
30 | $ cat .hg/hgrc | |
|
31 | # You may want to set your username here if it is not set | |||
|
32 | # globally, or this repository requires a different | |||
|
33 | # username from your usual configuration. If you want to | |||
|
34 | # set something for all of your repositories on this | |||
|
35 | # computer, try running the command | |||
|
36 | # 'hg config --edit --global' | |||
|
37 | # [ui] | |||
|
38 | # username = Jane Doe <jdoe@example.com> | |||
31 | [paths] |
|
39 | [paths] | |
32 | default = $TESTTMP/foo%bar (glob) |
|
40 | default = $TESTTMP/foo%bar (glob) | |
33 | $ hg paths |
|
41 | $ hg paths |
@@ -26,6 +26,14 b' Cloning with a password in the URL shoul' | |||||
26 | updating to branch default |
|
26 | updating to branch default | |
27 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
27 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
28 | $ cat test3/.hg/hgrc |
|
28 | $ cat test3/.hg/hgrc | |
|
29 | # You may want to set your username here if it is not set | |||
|
30 | # globally, or this repository requires a different | |||
|
31 | # username from your usual configuration. If you want to | |||
|
32 | # set something for all of your repositories on this | |||
|
33 | # computer, try running the command | |||
|
34 | # 'hg config --edit --global' | |||
|
35 | # [ui] | |||
|
36 | # username = Jane Doe <jdoe@example.com> | |||
29 | [paths] |
|
37 | [paths] | |
30 | default = http://foo@localhost:$HGPORT/ |
|
38 | default = http://foo@localhost:$HGPORT/ | |
31 | $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS |
|
39 | $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS |
@@ -36,6 +36,14 b'' | |||||
36 |
|
36 | |||
37 | $ cd b |
|
37 | $ cd b | |
38 | $ cat .hg/hgrc |
|
38 | $ cat .hg/hgrc | |
|
39 | # You may want to set your username here if it is not set | |||
|
40 | # globally, or this repository requires a different | |||
|
41 | # username from your usual configuration. If you want to | |||
|
42 | # set something for all of your repositories on this | |||
|
43 | # computer, try running the command | |||
|
44 | # 'hg config --edit --global' | |||
|
45 | # [ui] | |||
|
46 | # username = Jane Doe <jdoe@example.com> | |||
39 | [paths] |
|
47 | [paths] | |
40 | default = $TESTTMP/a#stable (glob) |
|
48 | default = $TESTTMP/a#stable (glob) | |
41 |
|
49 | |||
@@ -76,6 +84,14 b'' | |||||
76 | $ echo "green = ../a#default" >> .hg/hgrc |
|
84 | $ echo "green = ../a#default" >> .hg/hgrc | |
77 |
|
85 | |||
78 | $ cat .hg/hgrc |
|
86 | $ cat .hg/hgrc | |
|
87 | # You may want to set your username here if it is not set | |||
|
88 | # globally, or this repository requires a different | |||
|
89 | # username from your usual configuration. If you want to | |||
|
90 | # set something for all of your repositories on this | |||
|
91 | # computer, try running the command | |||
|
92 | # 'hg config --edit --global' | |||
|
93 | # [ui] | |||
|
94 | # username = Jane Doe <jdoe@example.com> | |||
79 | [paths] |
|
95 | [paths] | |
80 | default = $TESTTMP/a#stable (glob) |
|
96 | default = $TESTTMP/a#stable (glob) | |
81 | green = ../a#default |
|
97 | green = ../a#default |
@@ -41,6 +41,14 b' Test basic functionality of url#rev synt' | |||||
41 | summary: change a |
|
41 | summary: change a | |
42 |
|
42 | |||
43 | $ cat clone/.hg/hgrc |
|
43 | $ cat clone/.hg/hgrc | |
|
44 | # You may want to set your username here if it is not set | |||
|
45 | # globally, or this repository requires a different | |||
|
46 | # username from your usual configuration. If you want to | |||
|
47 | # set something for all of your repositories on this | |||
|
48 | # computer, try running the command | |||
|
49 | # 'hg config --edit --global' | |||
|
50 | # [ui] | |||
|
51 | # username = Jane Doe <jdoe@example.com> | |||
44 | [paths] |
|
52 | [paths] | |
45 | default = $TESTTMP/repo#foo (glob) |
|
53 | default = $TESTTMP/repo#foo (glob) | |
46 |
|
54 |
General Comments 0
You need to be logged in to leave comments.
Login now