##// END OF EJS Templates
remotenames: consider existing data while storing newer data...
Pulkit Goyal -
r35240:2ea6e42e default
parent child Browse files
Show More
@@ -64,6 +64,12 b' def writeremotenamefile(repo, remotepath'
64 # version '0' represents the very initial version of the storage format
64 # version '0' represents the very initial version of the storage format
65 f.write('0\n\n')
65 f.write('0\n\n')
66
66
67 olddata = set(readremotenamefile(repo, nametype))
68 # re-save the data from a different remote than this one.
69 for node, oldpath, rname in sorted(olddata):
70 if oldpath != remotepath:
71 f.write('%s\0%s\0%s\n' % (node, oldpath, rname))
72
67 for name, node in sorted(names.iteritems()):
73 for name, node in sorted(names.iteritems()):
68 if nametype == "branches":
74 if nametype == "branches":
69 for n in node:
75 for n in node:
@@ -102,10 +102,15 b' Pulling form the new server'
102 $ cat .hg/remotenames/bookmarks
102 $ cat .hg/remotenames/bookmarks
103 0
103 0
104
104
105 62615734edd52f06b6fb9c2beb429e4fe30d57b8\x00file:$TESTTMP/server\x00foo (esc)
106 87d6d66763085b629e6d7ed56778c79827273022\x00file:$TESTTMP/server\x00bar (esc)
105 87d6d66763085b629e6d7ed56778c79827273022\x00file:$TESTTMP/server2\x00bar (esc)
107 87d6d66763085b629e6d7ed56778c79827273022\x00file:$TESTTMP/server2\x00bar (esc)
106 62615734edd52f06b6fb9c2beb429e4fe30d57b8\x00file:$TESTTMP/server2\x00foo (esc)
108 62615734edd52f06b6fb9c2beb429e4fe30d57b8\x00file:$TESTTMP/server2\x00foo (esc)
109
107 $ cat .hg/remotenames/branches
110 $ cat .hg/remotenames/branches
108 0
111 0
109
112
113 3e1487808078543b0af6d10dadf5d46943578db0\x00file:$TESTTMP/server\x00wat (esc)
114 ec2426147f0e39dbc9cef599b066be6035ce691d\x00file:$TESTTMP/server\x00default (esc)
110 ec2426147f0e39dbc9cef599b066be6035ce691d\x00file:$TESTTMP/server2\x00default (esc)
115 ec2426147f0e39dbc9cef599b066be6035ce691d\x00file:$TESTTMP/server2\x00default (esc)
111 3e1487808078543b0af6d10dadf5d46943578db0\x00file:$TESTTMP/server2\x00wat (esc)
116 3e1487808078543b0af6d10dadf5d46943578db0\x00file:$TESTTMP/server2\x00wat (esc)
General Comments 0
You need to be logged in to leave comments. Login now