[PATCH] bookmarks: Avoid wrapping bundlerepository
Isaac Jurado
diptongo at gmail.com
Wed Jun 24 11:11:50 CDT 2009
> # HG changeset patch
> # User Isaac Jurado <diptongo at gmail.com>
> # Date 1245858603 -7200
> # Node ID 2b639960ea4e2640a8e80497a24efc566d2fb397
> # Parent 288ba6d6c5c76716e827a69a80938885adf8c7ba
> bookmarks: Avoid wrapping bundlerepository
>
> As bundlerepository inherits from localrepository, Bookmarks wraps it altering
> its behaviour in some way. In particular bundlerepository.__del__ is never
> called so uncompressed bundle files are not deleted from the .hg subdirectory.
>
> diff --git a/hgext/bookmarks.py b/hgext/bookmarks.py
> --- a/hgext/bookmarks.py
> +++ b/hgext/bookmarks.py
> @@ -30,7 +30,7 @@
>
> from mercurial.i18n import _
> from mercurial.node import nullid, nullrev, hex, short
> -from mercurial import util, commands, localrepo, repair, extensions
> +from mercurial import util, commands, bundlerepo, localrepo, repair, extensions
> import os
>
> def parse(repo):
> @@ -228,7 +228,7 @@
> write(repo, marks)
>
> def reposetup(ui, repo):
> - if not isinstance(repo, localrepo.localrepository):
> + if not isinstance(repo, localrepo.localrepository) or isinstance(repo, bundlerepo.bundlerepository):
> return
>
> # init a bookmark cache as otherwise we would get a infinite reading
>
Oh, I forgot to say that this intends to be a quick fix for issue 1611.
--
Isaac Jurado
http://www.krenel.net
"The noblest pleasure is the joy of understanding."
Leonardo da Vinci
More information about the Mercurial-devel
mailing list