def recordbookmarks(orig, store, fp): """Records all bookmark changes in the journal.""" repo = store._repo if util.safehasattr(repo, "journal"): oldmarks = bookmarks.bmstore(repo) for mark, value in pycompat.iteritems(store): oldvalue = oldmarks.get(mark, node.nullid) if value != oldvalue: repo.journal.record(bookmarktype, mark, oldvalue, value) return orig(store, fp)
def interestingmaster(repo, subset, x): """Interesting 'master' commit""" names = set(bookmarks.bmstore(repo).keys()) if util.safehasattr(repo, "names") and "remotebookmarks" in repo.names: names.update(set(repo.names["remotebookmarks"].listnames(repo))) for name in _reposnames(repo.ui): if name in names: revs = repo.revs("%s", name) break else: revs = repo.revs("last(public())") return subset & revs
def interestingheads(repo, subset, x): """Set of interesting bookmarks (local and remote)""" rev = repo.changelog.rev heads = set() books = bookmarks.bmstore(repo) ignore = re.compile(repo.ui.config("smartlog", "ignorebookmarks", "!")) for b in books: if not ignore.match(b): heads.add(rev(books[b])) # add 'interesting' remote bookmarks as well if util.safehasattr(repo, "names") and "remotebookmarks" in repo.names: ns = repo.names["remotebookmarks"] for name in _reposnames(repo.ui): nodes = ns.namemap(repo, name) if nodes: heads.add(rev(nodes[0])) return subset & smartset.baseset(heads, repo=repo)