--- a/hgext/journal.py Thu Dec 08 15:33:19 2022 +0100
+++ b/hgext/journal.py Thu Aug 31 23:56:15 2023 +0200
@@ -103,7 +103,7 @@
def wrapdirstate(orig, repo):
"""Make journal storage available to the dirstate object"""
dirstate = orig(repo)
- if util.safehasattr(repo, 'journal'):
+ if hasattr(repo, 'journal'):
_setupdirstate(repo, dirstate)
return dirstate
@@ -112,7 +112,7 @@
"""Records all dirstate parent changes in the journal."""
old = list(old)
new = list(new)
- if util.safehasattr(dirstate, 'journalstorage'):
+ if hasattr(dirstate, 'journalstorage'):
# only record two hashes if there was a merge
oldhashes = old[:1] if old[1] == dirstate._nodeconstants.nullid else old
newhashes = new[:1] if new[1] == dirstate._nodeconstants.nullid else new
@@ -125,7 +125,7 @@
def recordbookmarks(orig, store, fp):
"""Records all bookmark changes in the journal."""
repo = store._repo
- if util.safehasattr(repo, 'journal'):
+ if hasattr(repo, 'journal'):
oldmarks = bookmarks.bmstore(repo)
all_marks = set(b for b, n in oldmarks.items())
all_marks.update(b for b, n in store.items())
@@ -185,11 +185,7 @@
def unsharejournal(orig, ui, repo, repopath):
"""Copy shared journal entries into this repo when unsharing"""
- if (
- repo.path == repopath
- and repo.shared()
- and util.safehasattr(repo, 'journal')
- ):
+ if repo.path == repopath and repo.shared() and hasattr(repo, 'journal'):
sharedrepo = hg.sharedreposource(repo)
sharedfeatures = _readsharedfeatures(repo)
if sharedrepo and sharedfeatures > {b'journal'}: