Show More
@@ -11,6 +11,7 b' from __future__ import absolute_import' | |||||
11 | from .node import hex |
|
11 | from .node import hex | |
12 |
|
12 | |||
13 | from . import ( |
|
13 | from . import ( | |
|
14 | util, | |||
14 | vfs as vfsmod, |
|
15 | vfs as vfsmod, | |
15 | ) |
|
16 | ) | |
16 |
|
17 | |||
@@ -94,6 +95,30 b' def saveremotenames(repo, remotepath, br' | |||||
94 | finally: |
|
95 | finally: | |
95 | wlock.release() |
|
96 | wlock.release() | |
96 |
|
97 | |||
|
98 | def activepath(repo, remote): | |||
|
99 | """returns remote path""" | |||
|
100 | local = None | |||
|
101 | # is the remote a local peer | |||
|
102 | local = remote.local() | |||
|
103 | ||||
|
104 | # determine the remote path from the repo, if possible; else just | |||
|
105 | # use the string given to us | |||
|
106 | rpath = remote | |||
|
107 | if local: | |||
|
108 | rpath = remote._repo.root | |||
|
109 | elif not isinstance(remote, str): | |||
|
110 | rpath = remote._url | |||
|
111 | ||||
|
112 | # represent the remotepath with user defined path name if exists | |||
|
113 | for path, url in repo.ui.configitems('paths'): | |||
|
114 | # remove auth info from user defined url | |||
|
115 | url = util.removeauth(url) | |||
|
116 | if url == rpath: | |||
|
117 | rpath = path | |||
|
118 | break | |||
|
119 | ||||
|
120 | return rpath | |||
|
121 | ||||
97 | def pullremotenames(localrepo, remoterepo): |
|
122 | def pullremotenames(localrepo, remoterepo): | |
98 | """ |
|
123 | """ | |
99 | pulls bookmarks and branches information of the remote repo during a |
|
124 | pulls bookmarks and branches information of the remote repo during a | |
@@ -101,7 +126,7 b' def pullremotenames(localrepo, remoterep' | |||||
101 | localrepo is our local repository |
|
126 | localrepo is our local repository | |
102 | remoterepo is the peer instance |
|
127 | remoterepo is the peer instance | |
103 | """ |
|
128 | """ | |
104 |
remotepath = remoterepo |
|
129 | remotepath = activepath(localrepo, remoterepo) | |
105 | bookmarks = remoterepo.listkeys('bookmarks') |
|
130 | bookmarks = remoterepo.listkeys('bookmarks') | |
106 | # on a push, we don't want to keep obsolete heads since |
|
131 | # on a push, we don't want to keep obsolete heads since | |
107 | # they won't show up as heads on the next pull, so we |
|
132 | # they won't show up as heads on the next pull, so we |
@@ -57,14 +57,14 b' Making a client repo' | |||||
57 | $ cat .hg/logexchange/bookmarks |
|
57 | $ cat .hg/logexchange/bookmarks | |
58 | 0 |
|
58 | 0 | |
59 |
|
59 | |||
60 |
87d6d66763085b629e6d7ed56778c79827273022\ |
|
60 | 87d6d66763085b629e6d7ed56778c79827273022\x00default\x00bar (esc) | |
61 |
62615734edd52f06b6fb9c2beb429e4fe30d57b8\ |
|
61 | 62615734edd52f06b6fb9c2beb429e4fe30d57b8\x00default\x00foo (esc) | |
62 |
|
62 | |||
63 | $ cat .hg/logexchange/branches |
|
63 | $ cat .hg/logexchange/branches | |
64 | 0 |
|
64 | 0 | |
65 |
|
65 | |||
66 |
ec2426147f0e39dbc9cef599b066be6035ce691d\ |
|
66 | ec2426147f0e39dbc9cef599b066be6035ce691d\x00default\x00default (esc) | |
67 |
3e1487808078543b0af6d10dadf5d46943578db0\ |
|
67 | 3e1487808078543b0af6d10dadf5d46943578db0\x00default\x00wat (esc) | |
68 |
|
68 | |||
69 | Making a new server |
|
69 | Making a new server | |
70 | ------------------- |
|
70 | ------------------- | |
@@ -94,15 +94,15 b' Pulling form the new server' | |||||
94 | $ cat .hg/logexchange/bookmarks |
|
94 | $ cat .hg/logexchange/bookmarks | |
95 | 0 |
|
95 | 0 | |
96 |
|
96 | |||
97 |
62615734edd52f06b6fb9c2beb429e4fe30d57b8\ |
|
97 | 62615734edd52f06b6fb9c2beb429e4fe30d57b8\x00default\x00foo (esc) | |
98 |
87d6d66763085b629e6d7ed56778c79827273022\ |
|
98 | 87d6d66763085b629e6d7ed56778c79827273022\x00default\x00bar (esc) | |
99 |
87d6d66763085b629e6d7ed56778c79827273022\ |
|
99 | 87d6d66763085b629e6d7ed56778c79827273022\x00$TESTTMP/server2\x00bar (esc) | |
100 |
62615734edd52f06b6fb9c2beb429e4fe30d57b8\ |
|
100 | 62615734edd52f06b6fb9c2beb429e4fe30d57b8\x00$TESTTMP/server2\x00foo (esc) | |
101 |
|
101 | |||
102 | $ cat .hg/logexchange/branches |
|
102 | $ cat .hg/logexchange/branches | |
103 | 0 |
|
103 | 0 | |
104 |
|
104 | |||
105 |
3e1487808078543b0af6d10dadf5d46943578db0\ |
|
105 | 3e1487808078543b0af6d10dadf5d46943578db0\x00default\x00wat (esc) | |
106 |
ec2426147f0e39dbc9cef599b066be6035ce691d\ |
|
106 | ec2426147f0e39dbc9cef599b066be6035ce691d\x00default\x00default (esc) | |
107 |
ec2426147f0e39dbc9cef599b066be6035ce691d\ |
|
107 | ec2426147f0e39dbc9cef599b066be6035ce691d\x00$TESTTMP/server2\x00default (esc) | |
108 |
3e1487808078543b0af6d10dadf5d46943578db0\ |
|
108 | 3e1487808078543b0af6d10dadf5d46943578db0\x00$TESTTMP/server2\x00wat (esc) |
General Comments 0
You need to be logged in to leave comments.
Login now