[Python-apps-commits] r12246 - in packages/hg-git/trunk/debian (9 files)
vicho at users.alioth.debian.org
vicho at users.alioth.debian.org
Sun Aug 16 14:02:42 UTC 2015
Date: Sunday, August 16, 2015 @ 14:02:41
Author: vicho
Revision: 12246
Add 6 patches from upstream to make mercurial-git 0.8.1 work with mercurial 3.5-1 (Closes: #794987)
Added:
packages/hg-git/trunk/debian/patches/
packages/hg-git/trunk/debian/patches/from_upstream__adapt_pull_wrapper_function_for_recent_hg.patch
packages/hg-git/trunk/debian/patches/from_upstream__evaluate_ignore_readpats_to_see_if_ignore_modules_really_exists.patch
packages/hg-git/trunk/debian/patches/from_upstream__update_for_bookmark_changes_in_mercurial_3_5.patch
packages/hg-git/trunk/debian/patches/from_upstream__update_ignore_logic_to_match_upstream.patch
packages/hg-git/trunk/debian/patches/from_upstream__update_test_output_with_summary_phase_info.patch
packages/hg-git/trunk/debian/patches/from_upstream__update_tests_for_new_git_output.patch
packages/hg-git/trunk/debian/patches/series
Modified:
packages/hg-git/trunk/debian/changelog
Modified: packages/hg-git/trunk/debian/changelog
===================================================================
--- packages/hg-git/trunk/debian/changelog 2015-08-16 10:25:34 UTC (rev 12245)
+++ packages/hg-git/trunk/debian/changelog 2015-08-16 14:02:41 UTC (rev 12246)
@@ -1,3 +1,10 @@
+hg-git (0.8.1-3) UNRELEASED; urgency=medium
+
+ * Add 6 patches from upstream to make mercurial-git 0.8.1 work with
+ mercurial 3.5-1 (Closes: #794987)
+
+ -- Javi Merino <vicho at debian.org> Sun, 09 Aug 2015 19:22:08 +0100
+
hg-git (0.8.1-2) unstable; urgency=medium
* Fix "hg help git" fails due to missing help/ directory (Closes: #743463)
Added: packages/hg-git/trunk/debian/patches/from_upstream__adapt_pull_wrapper_function_for_recent_hg.patch
===================================================================
--- packages/hg-git/trunk/debian/patches/from_upstream__adapt_pull_wrapper_function_for_recent_hg.patch (rev 0)
+++ packages/hg-git/trunk/debian/patches/from_upstream__adapt_pull_wrapper_function_for_recent_hg.patch 2015-08-16 14:02:41 UTC (rev 12246)
@@ -0,0 +1,28 @@
+Author: Augie Fackler <augie at google.com>
+Origin: https://bitbucket.org/durin42/hg-git/commits/b1b03873c9adcc70d37edfa7e26e4bae0ab4f0aa
+Description: hggit: adapt pull wrapper function for recent hg
+ We can just accept-and-forward kwargs, which should be nicely
+ futureproof for a while.
+
+diff --git a/hggit/__init__.py b/hggit/__init__.py
+--- a/hggit/__init__.py
++++ b/hggit/__init__.py
+@@ -241,7 +241,8 @@ def peer(orig, uiorrepo, *args, **opts):
+ extensions.wrapfunction(hg, 'peer', peer)
+
+ @util.transform_notgit
+-def exchangepull(orig, repo, remote, heads=None, force=False, bookmarks=()):
++def exchangepull(orig, repo, remote, heads=None, force=False, bookmarks=(),
++ **kwargs):
+ if isinstance(remote, gitrepo.gitrepo):
+ # transaction manager is present in Mercurial >= 3.3
+ try:
+@@ -269,7 +270,7 @@ def exchangepull(orig, repo, remote, hea
+ lock.release()
+ wlock.release()
+ else:
+- return orig(repo, remote, heads, force, bookmarks=bookmarks)
++ return orig(repo, remote, heads, force, bookmarks=bookmarks, **kwargs)
+ if not hgutil.safehasattr(localrepo.localrepository, 'pull'):
+ # Mercurial >= 3.2
+ extensions.wrapfunction(exchange, 'pull', exchangepull)
Added: packages/hg-git/trunk/debian/patches/from_upstream__evaluate_ignore_readpats_to_see_if_ignore_modules_really_exists.patch
===================================================================
--- packages/hg-git/trunk/debian/patches/from_upstream__evaluate_ignore_readpats_to_see_if_ignore_modules_really_exists.patch (rev 0)
+++ packages/hg-git/trunk/debian/patches/from_upstream__evaluate_ignore_readpats_to_see_if_ignore_modules_really_exists.patch 2015-08-16 14:02:41 UTC (rev 12246)
@@ -0,0 +1,32 @@
+Author: Yuya Nishihara <yuya at tcha.org>
+Origin: https://bitbucket.org/durin42/hg-git/commits/67b27ec080ae1d8ea9f3cb8dc8d83ed5578d840f
+Description: ignore: evaluate ignore.readpats to see if ignore module really exists
+ Otherwise ImportError wouldn't be raised thanks to demandimport.
+ .
+ Perhaps tests passed at e5b10a710036 because we are likely to have ignore.pyc
+ in our mercurial tree.
+
+diff --git a/hggit/__init__.py b/hggit/__init__.py
+index fa504bf..42a6412 100644
+--- a/hggit/__init__.py
++++ b/hggit/__init__.py
+@@ -36,6 +36,7 @@ from mercurial import help
+ from mercurial import hg
+ try:
+ from mercurial import ignore
++ ignore.readpats
+ ignoremod = True
+ except ImportError:
+ # The ignore module disappeared in Mercurial 3.5
+diff --git a/hggit/gitdirstate.py b/hggit/gitdirstate.py
+index 60732d4..6c52217 100644
+--- a/hggit/gitdirstate.py
++++ b/hggit/gitdirstate.py
+@@ -6,6 +6,7 @@ import errno
+ from mercurial import dirstate
+ try:
+ from mercurial import ignore
++ ignore.readpats
+ ignoremod = True
+ except:
+ # ignore module was removed in Mercurial 3.5
Added: packages/hg-git/trunk/debian/patches/from_upstream__update_for_bookmark_changes_in_mercurial_3_5.patch
===================================================================
--- packages/hg-git/trunk/debian/patches/from_upstream__update_for_bookmark_changes_in_mercurial_3_5.patch (rev 0)
+++ packages/hg-git/trunk/debian/patches/from_upstream__update_for_bookmark_changes_in_mercurial_3_5.patch 2015-08-16 14:02:41 UTC (rev 12246)
@@ -0,0 +1,33 @@
+Author: Sean Farley <sean at farley.io>
+Origin: https://bitbucket.org/durin42/hg-git/commits/286555803dae49c302e9e37b468ae94d1dd58962
+Description: git_handler: update for bookmark changes in mercurial 3.5
+
+diff --git a/hggit/git_handler.py b/hggit/git_handler.py
+--- a/hggit/git_handler.py
++++ b/hggit/git_handler.py
+@@ -262,7 +262,11 @@ class GitHandler(object):
+ bms = getattr(self.repo['tip'], 'bookmarks',
+ lambda: None)()
+ if bms:
+- bookmarks.setcurrent(self.repo, bms[0])
++ try:
++ bookmarks.activate(self.repo, bms[0])
++ except AttributeError:
++ # hg < 3.5
++ bookmarks.setcurrent(self.repo, bms[0])
+
+ self.save_map(self.map_file)
+
+@@ -1010,7 +1014,11 @@ class GitHandler(object):
+ except NameError:
+ bookmarks.bookmark(self.ui, self.repo, 'master',
+ rev=tip, force=True)
+- bookmarks.setcurrent(self.repo, 'master')
++ try:
++ bookmarks.activate(self.repo, 'master')
++ except AttributeError:
++ # hg < 3.5
++ bookmarks.setcurrent(self.repo, 'master')
+ new_refs['refs/heads/master'] = self.map_git_get(tip)
+
+ for rev, rev_refs in exportable.iteritems():
Added: packages/hg-git/trunk/debian/patches/from_upstream__update_ignore_logic_to_match_upstream.patch
===================================================================
--- packages/hg-git/trunk/debian/patches/from_upstream__update_ignore_logic_to_match_upstream.patch (rev 0)
+++ packages/hg-git/trunk/debian/patches/from_upstream__update_ignore_logic_to_match_upstream.patch 2015-08-16 14:02:41 UTC (rev 12246)
@@ -0,0 +1,92 @@
+Author: Durham Goode <durham at fb.com>
+Origin: https://bitbucket.org/durin42/hg-git/commits/e5b10a710036dbfcf146f9d627d860f6b05ef0e0
+Description: ignore: update ignore logic to match upstream
+ Upstream mercurial has dropped the ignore module and replaced it with 'include:'
+ patterns. Let's do the same in hggit.
+ .
+ Ran tests against Mercurial latest (6ac860f700b5) and Mercurial 3.4.
+
+diff --git a/hggit/__init__.py b/hggit/__init__.py
+index e78357b..fa504bf 100644
+--- a/hggit/__init__.py
++++ b/hggit/__init__.py
+@@ -34,7 +34,12 @@ except ImportError:
+ from mercurial import extensions
+ from mercurial import help
+ from mercurial import hg
+-from mercurial import ignore
++try:
++ from mercurial import ignore
++ ignoremod = True
++except ImportError:
++ # The ignore module disappeared in Mercurial 3.5
++ ignoremod = False
+ from mercurial import localrepo
+ from mercurial import manifest
+ from mercurial.node import hex
+@@ -164,10 +169,13 @@ def gverify(ui, repo, **opts):
+ return verify.verify(ui, repo, ctx)
+
+ if (getattr(dirstate, 'rootcache', False) and
+- getattr(ignore, 'readpats', False)):
++ (not ignoremod or getattr(ignore, 'readpats', False))):
+ # only install our dirstate wrapper if it has a hope of working
+ import gitdirstate
+- extensions.wrapfunction(ignore, 'ignore', gitdirstate.gignore)
++ if ignoremod:
++ def ignorewrap(orig, *args, **kwargs):
++ return gitdirstate.gignore(*args, **kwargs)
++ extensions.wrapfunction(ignore, 'ignore', ignorewrap)
+ dirstate.dirstate = gitdirstate.gitdirstate
+
+ @command('git-cleanup')
+diff --git a/hggit/gitdirstate.py b/hggit/gitdirstate.py
+index 71088fb..60732d4 100644
+--- a/hggit/gitdirstate.py
++++ b/hggit/gitdirstate.py
+@@ -4,7 +4,12 @@ import re
+ import errno
+
+ from mercurial import dirstate
+-from mercurial import ignore
++try:
++ from mercurial import ignore
++ ignoremod = True
++except:
++ # ignore module was removed in Mercurial 3.5
++ ignoremod = False
+ from mercurial import match as matchmod
+ from mercurial import osutil
+ from mercurial import scmutil
+@@ -62,13 +67,18 @@ def gignorepats(orig, lines, root=None):
+
+ return patterns, warnings
+
+-def gignore(orig, root, files, warn, extrapatterns=None):
+- pats = ignore.readpats(root, files, warn)
++def gignore(root, files, warn, extrapatterns=None):
+ allpats = []
++ pats = []
++ if ignoremod:
++ pats = ignore.readpats(root, files, warn)
++ for f, patlist in pats:
++ allpats.extend(patlist)
++ else:
++ allpats.extend(['include:%s' % f for f in files])
++
+ if extrapatterns:
+ allpats.extend(extrapatterns)
+- for f, patlist in pats:
+- allpats.extend(patlist)
+ if not allpats:
+ return util.never
+ try:
+@@ -110,7 +120,7 @@ class gitdirstate(dirstate.dirstate):
+ for warning in warnings:
+ self._ui.warn("%s: %s\n" % (fn, warning))
+ patterns.extend(pats)
+- return ignore.ignore(self._root, files, self._ui.warn,
++ return gignore(self._root, files, self._ui.warn,
+ extrapatterns=patterns)
+
+ def _finddotgitignores(self):
Added: packages/hg-git/trunk/debian/patches/from_upstream__update_test_output_with_summary_phase_info.patch
===================================================================
--- packages/hg-git/trunk/debian/patches/from_upstream__update_test_output_with_summary_phase_info.patch (rev 0)
+++ packages/hg-git/trunk/debian/patches/from_upstream__update_test_output_with_summary_phase_info.patch 2015-08-16 14:02:41 UTC (rev 12246)
@@ -0,0 +1,19 @@
+Author: Durham Goode <durham at fb.com>
+Origin: https://bitbucket.org/durin42/hg-git/commits/b022478ae3d13114a1f6a85760409c3a9a4c1831
+Description: test: update test output with summary phase info
+ Upstream Mercurial has added phase info to the summary output. Let's update the
+ test to reflect that.
+
+diff --git a/tests/test-push.t b/tests/test-push.t
+--- a/tests/test-push.t
++++ b/tests/test-push.t
+@@ -192,7 +192,8 @@ The remote repo is empty and the local o
+ searching for changes
+ adding objects
+ added 1 commits with 1 trees and 1 blobs
+- $ hg summary
++(the phases line was added in Mercurial 3.5)
++ $ hg summary | grep -Ev '^phases:'
+ parent: -1:000000000000 (no revision checked out)
+ branch: default
+ commit: (clean)
Added: packages/hg-git/trunk/debian/patches/from_upstream__update_tests_for_new_git_output.patch
===================================================================
--- packages/hg-git/trunk/debian/patches/from_upstream__update_tests_for_new_git_output.patch (rev 0)
+++ packages/hg-git/trunk/debian/patches/from_upstream__update_tests_for_new_git_output.patch 2015-08-16 14:02:41 UTC (rev 12246)
@@ -0,0 +1,25 @@
+Author: Sean Farley <sean at farley.io>
+Origin: https://bitbucket.org/durin42/hg-git/commits/d8ac1b54766b2fb75a75166730af66f4fb0a61b7
+Description: tests: update tests for new git output, sigh
+
+diff --git a/tests/test-bookmark-workflow.t b/tests/test-bookmark-workflow.t
+--- a/tests/test-bookmark-workflow.t
++++ b/tests/test-bookmark-workflow.t
+@@ -61,7 +61,7 @@ Initialize remote hg and git repos with
+ > done
+ $ git branch b1 9497a4e
+ $ gitstate
+- 55b133e "add delta" refs: (master)
++ 55b133e "add delta" refs: (*master) (glob)
+ d338971 "add gamma" refs:
+ 9497a4e "add beta" refs: (b1)
+ 7eeab2e "add alpha" refs:
+@@ -184,7 +184,7 @@ This changed in 3.4 to start showing cha
+ $ git add epsilon
+ $ gitcommit -m 'add epsilon'
+ $ gitstate
+- fcfd2c0 "add epsilon" refs: (b4)
++ fcfd2c0 "add epsilon" refs: (*b4) (glob)
+ 55b133e "add delta" refs: (master, b3)
+ d338971 "add gamma" refs:
+ 9497a4e "add beta" refs: (b1)
Added: packages/hg-git/trunk/debian/patches/series
===================================================================
--- packages/hg-git/trunk/debian/patches/series (rev 0)
+++ packages/hg-git/trunk/debian/patches/series 2015-08-16 14:02:41 UTC (rev 12246)
@@ -0,0 +1,6 @@
+from_upstream__update_tests_for_new_git_output.patch
+from_upstream__update_for_bookmark_changes_in_mercurial_3_5.patch
+from_upstream__update_ignore_logic_to_match_upstream.patch
+from_upstream__update_test_output_with_summary_phase_info.patch
+from_upstream__evaluate_ignore_readpats_to_see_if_ignore_modules_really_exists.patch
+from_upstream__adapt_pull_wrapper_function_for_recent_hg.patch
More information about the Python-apps-commits
mailing list