Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Avoid upcoming incompatibility with Mercurial 3.8 #24

Open
fingolfin opened this issue Feb 23, 2016 · 2 comments
Open

Avoid upcoming incompatibility with Mercurial 3.8 #24

fingolfin opened this issue Feb 23, 2016 · 2 comments

Comments

@fingolfin
Copy link
Owner

In Mercurial 3.7, we now get this warning:

devel-warn: bm.write() is deprecated, use bm.recordchange(transaction)
(compatibility will be dropped after Mercurial-3.7, update your code.) at: /Users/mhorn/bin/git-remote-hg:403 (updatebookmarks)

First off: It's very nice that at least now they warn before making such changes!

Next, to fix this, we need to update the updatebookmarks function, which currently does this:

...
    if hasattr(localmarks, 'write'):
        localmarks.write()
    else:
        bookmarks.write(repo)

and it probably should be something like this instead:

    if check_version(3, 6):
        TODO
    elif hasattr(localmarks, 'write'):
        localmarks.write()
    else:
        bookmarks.write(repo)

The big question is that the "TODO" should be. We could temporarily create a transaction, then invoke bookmarks.recordchange(transaction) and close the transaction. This has the advantage of keeping the change local.

Or, we could start taking advantage of transactions in the git-remote-hg code. However, transactions haven't been around that long in Mercuriual... so probably better to go with the minimal change for now.

@orivej
Copy link

orivej commented Mar 26, 2017

@felipec did this: felipec@822c6e4

@orivej
Copy link

orivej commented Mar 26, 2017

Currently https://github.com/mnauw/git-remote-hg leads development of git-remote-hg and provides compatibility even with Hg 4.0. It seems better to merge your fork into @mnauw's than to continue independent development.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants