Mercurial > hg
comparison mercurial/bookmarks.py @ 18849:b4ddc43ddf9d
bookmarks.updatefromremote: rename local rb to remotemarks
This local will become a parameter in an upcoming patch, so give it a more
descriptive name. The name stays similar to the existing localmarks.
author | Siddharth Agarwal <sid0@fb.com> |
---|---|
date | Fri, 29 Mar 2013 18:28:59 -0700 |
parents | 37ce336ab2dd |
children | a60963c02f92 |
comparison
equal
deleted
inserted
replaced
18848:cc741817a49e | 18849:b4ddc43ddf9d |
---|---|
221 finally: | 221 finally: |
222 w.release() | 222 w.release() |
223 | 223 |
224 def updatefromremote(ui, repo, remote, path): | 224 def updatefromremote(ui, repo, remote, path): |
225 ui.debug("checking for updated bookmarks\n") | 225 ui.debug("checking for updated bookmarks\n") |
226 rb = remote.listkeys('bookmarks') | 226 remotemarks = remote.listkeys('bookmarks') |
227 changed = False | 227 changed = False |
228 localmarks = repo._bookmarks | 228 localmarks = repo._bookmarks |
229 for k in sorted(rb): | 229 for k in sorted(remotemarks): |
230 if k in localmarks: | 230 if k in localmarks: |
231 nr, nl = rb[k], localmarks[k] | 231 nr, nl = remotemarks[k], localmarks[k] |
232 if nr in repo: | 232 if nr in repo: |
233 cr = repo[nr] | 233 cr = repo[nr] |
234 cl = repo[nl] | 234 cl = repo[nl] |
235 if cl.rev() >= cr.rev(): | 235 if cl.rev() >= cr.rev(): |
236 continue | 236 continue |
255 n = '%s@%s' % (kd, p) | 255 n = '%s@%s' % (kd, p) |
256 | 256 |
257 localmarks[n] = cr.node() | 257 localmarks[n] = cr.node() |
258 changed = True | 258 changed = True |
259 ui.warn(_("divergent bookmark %s stored as %s\n") % (k, n)) | 259 ui.warn(_("divergent bookmark %s stored as %s\n") % (k, n)) |
260 elif rb[k] in repo: | 260 elif remotemarks[k] in repo: |
261 # add remote bookmarks for changes we already have | 261 # add remote bookmarks for changes we already have |
262 localmarks[k] = repo[rb[k]].node() | 262 localmarks[k] = repo[remotemarks[k]].node() |
263 changed = True | 263 changed = True |
264 ui.status(_("adding remote bookmark %s\n") % k) | 264 ui.status(_("adding remote bookmark %s\n") % k) |
265 | 265 |
266 if changed: | 266 if changed: |
267 localmarks.write() | 267 localmarks.write() |