changeset 965:07473e474bc4

merge
author Siddharth Agarwal <sid0@fb.com>
date Thu, 31 Dec 2015 12:45:30 -0800
parents b867b5f0a63a (diff) 06385a2b30f3 (current diff)
children be627eeee5a9
files hggit/__init__.py hggit/git_handler.py hggit/gitdirstate.py hggit/overlay.py
diffstat 7 files changed, 60 insertions(+), 34 deletions(-) [+]
line wrap: on
line diff
--- a/hggit/__init__.py	Tue Dec 29 18:06:14 2015 +0000
+++ b/hggit/__init__.py	Thu Dec 31 12:45:30 2015 -0800
@@ -29,23 +29,25 @@
 
 from bisect import insort
 from git_handler import GitHandler
-from mercurial import bundlerepo
-from mercurial import cmdutil
-from mercurial import demandimport
-from mercurial import dirstate
-from mercurial import discovery
-from mercurial import extensions
-from mercurial import help
-from mercurial import hg
-from mercurial import localrepo
-from mercurial import manifest
-from mercurial import revset
-from mercurial import scmutil
-from mercurial import templatekw
-from mercurial import ui as hgui
-from mercurial import util as hgutil
 from mercurial.node import hex
 from mercurial.i18n import _
+from mercurial import (
+    bundlerepo,
+    cmdutil,
+    demandimport,
+    dirstate,
+    discovery,
+    extensions,
+    help,
+    hg,
+    ui as hgui,
+    util as hgutil,
+    localrepo,
+    manifest,
+    revset,
+    scmutil,
+    templatekw,
+)
 
 try:
     from mercurial import exchange
--- a/hggit/_ssh.py	Tue Dec 29 18:06:14 2015 +0000
+++ b/hggit/_ssh.py	Thu Dec 31 12:45:30 2015 -0800
@@ -1,7 +1,10 @@
 from dulwich.client import SubprocessWrapper
-from mercurial import util
 import subprocess
 
+from mercurial import (
+    util,
+)
+
 class SSHVendor(object):
     """Parent class for ui-linked Vendor classes."""
 
--- a/hggit/git_handler.py	Tue Dec 29 18:06:14 2015 +0000
+++ b/hggit/git_handler.py	Thu Dec 31 12:45:30 2015 -0800
@@ -17,10 +17,14 @@
 
 from mercurial.i18n import _
 from mercurial.node import hex, bin, nullid
-from mercurial import bookmarks
-from mercurial import commands
-from mercurial import context, util as hgutil
-from mercurial import url
+from mercurial import (
+    bookmarks,
+    commands,
+    context,
+    util as hgutil,
+    lock as lockmod,
+    url,
+)
 
 import _ssh
 import git2hg
@@ -1308,11 +1312,19 @@
                         bms[head + suffix] = hgsha
 
             if heads:
-                wlock = self.repo.wlock()
+                tr = lock = wlock = None
                 try:
-                    bms.write()
+                    wlock = self.repo.wlock()
+                    lock = self.repo.lock()
+                    tr = self.repo.transaction('git_handler')
+                    if hgutil.safehasattr(bms, 'recordchange'):
+                        # recordchange was added in mercurial 3.2
+                        bms.recordchange(tr)
+                    else:
+                        bms.write()
+                    tr.close()
                 finally:
-                    wlock.release()
+                    lockmod.release(tr, lock, wlock)
 
         except AttributeError:
             self.ui.warn(_('creating bookmarks failed, do you have'
--- a/hggit/gitdirstate.py	Tue Dec 29 18:06:14 2015 +0000
+++ b/hggit/gitdirstate.py	Thu Dec 31 12:45:30 2015 -0800
@@ -3,7 +3,14 @@
 import re
 import errno
 
-from mercurial import dirstate
+from mercurial import (
+    dirstate,
+    match as matchmod,
+    osutil,
+    scmutil,
+    util,
+)
+
 try:
     from mercurial import ignore
     ignore.readpats
@@ -11,16 +18,12 @@
 except (AttributeError, ImportError):
     # ignore module was removed in Mercurial 3.5
     ignoremod = False
-from mercurial import match as matchmod
-from mercurial import osutil
-from mercurial import scmutil
 # pathauditor moved to pathutil in 2.8
 try:
     from mercurial import pathutil
     pathutil.pathauditor
 except (AttributeError, ImportError):
     pathutil = scmutil
-from mercurial import util
 from mercurial.i18n import _
 
 def gignorepats(orig, lines, root=None):
--- a/hggit/hg2git.py	Tue Dec 29 18:06:14 2015 +0000
+++ b/hggit/hg2git.py	Thu Dec 31 12:45:30 2015 -0800
@@ -6,7 +6,9 @@
 import stat
 
 import dulwich.objects as dulobjs
-from mercurial import util as hgutil
+from mercurial import (
+    util as hgutil,
+)
 
 import compat
 import util
--- a/hggit/hgrepo.py	Tue Dec 29 18:06:14 2015 +0000
+++ b/hggit/hgrepo.py	Thu Dec 31 12:45:30 2015 -0800
@@ -1,6 +1,8 @@
-from mercurial import localrepo
+from mercurial import (
+    util as hgutil,
+    localrepo,
+)
 from mercurial.node import bin
-from mercurial import util as hgutil
 
 from git_handler import GitHandler
 from gitrepo import gitrepo
--- a/hggit/overlay.py	Tue Dec 29 18:06:14 2015 +0000
+++ b/hggit/overlay.py	Thu Dec 31 12:45:30 2015 -0800
@@ -4,9 +4,11 @@
 #
 # incomplete, implemented on demand
 
-from mercurial import ancestor
-from mercurial import manifest
-from mercurial import context
+from mercurial import (
+    ancestor,
+    manifest,
+    context,
+)
 from mercurial.node import bin, hex, nullid
 
 def _maybehex(n):