##// END OF EJS Templates
bookmarks: remove changectx() method from bmstore (API)...
Augie Fackler -
r43248:e3bb2a58 default
parent child Browse files
Show More
@@ -12,6 +12,7 b' from mercurial import ('
12 12 changegroup,
13 13 error,
14 14 extensions,
15 node as nodemod,
15 16 revsetlang,
16 17 util,
17 18 )
@@ -48,7 +49,7 b' def getscratchbranchparts(repo, peer, ou'
48 49 params['bookprevnode'] = ''
49 50 bookmarks = repo._bookmarks
50 51 if bookmark in bookmarks:
51 params['bookprevnode'] = bookmarks.changectx(bookmark).hex()
52 params['bookprevnode'] = nodemod.hex(bookmarks[bookmark])
52 53
53 54 # Do not send pushback bundle2 part with bookmarks if remotenames extension
54 55 # is enabled. It will be handled manually in `_push()`
@@ -177,10 +177,6 b' class bmstore(object):'
177 177 """Return a sorted list of bookmarks pointing to the specified node"""
178 178 return self._nodemap.get(node, [])
179 179
180 def changectx(self, mark):
181 node = self._refmap[mark]
182 return self._repo[node]
183
184 180 def applychanges(self, repo, tr, changes):
185 181 """Apply a list of changes to bookmarks
186 182 """
@@ -271,7 +267,7 b' class bmstore(object):'
271 267 return []
272 268 rev = self._repo[target].rev()
273 269 anc = self._repo.changelog.ancestors([rev])
274 bmctx = self.changectx(mark)
270 bmctx = self._repo[self[mark]]
275 271 divs = [self._refmap[b] for b in self._refmap
276 272 if b.split('@', 1)[0] == mark.split('@', 1)[0]]
277 273
@@ -412,11 +408,11 b' def update(repo, parents, node):'
412 408 bmchanges = []
413 409 if marks[active] in parents:
414 410 new = repo[node]
415 divs = [marks.changectx(b) for b in marks
411 divs = [repo[marks[b]] for b in marks
416 412 if b.split('@', 1)[0] == active.split('@', 1)[0]]
417 413 anc = repo.changelog.ancestors([new.rev()])
418 414 deletefrom = [b.node() for b in divs if b.rev() in anc or b == new]
419 if validdest(repo, marks.changectx(active), new):
415 if validdest(repo, repo[marks[active]], new):
420 416 bmchanges.append((active, new.node()))
421 417
422 418 for bm in divergent2delete(repo, deletefrom, active):
@@ -301,7 +301,7 b' def _nowarnheads(pushop):'
301 301 for bm in localbookmarks:
302 302 rnode = remotebookmarks.get(bm)
303 303 if rnode and rnode in repo:
304 lctx, rctx = localbookmarks.changectx(bm), repo[rnode]
304 lctx, rctx = repo[localbookmarks[bm]], repo[rnode]
305 305 if bookmarks.validdest(repo, rctx, lctx):
306 306 bookmarkedheads.add(lctx.node())
307 307 else:
General Comments 0
You need to be logged in to leave comments. Login now