PageRenderTime 52ms CodeModel.GetById 23ms RepoModel.GetById 0ms app.codeStats 0ms

/dev-vcs/hg-git/files/hg-git-0.8.12-hg-4.8.patch

https://gitlab.com/argent/portage
Patch | 219 lines | 203 code | 16 blank | 0 comment | 0 complexity | b4325de20f0c7f34ac8d6e8c86802346 MD5 | raw file
  1. https://bitbucket.org/durin42/hg-git/commits/ae6b1ba7482963bc9de51f299891e99005794e4e/raw
  2. https://bitbucket.org/durin42/hg-git/commits/143b7511eadbea7507d847c805241a6db290ffe7/raw
  3. https://bitbucket.org/durin42/hg-git/commits/8d00fde45adbc6c3c0ccab8e362b5f5c36c171e6/raw
  4. # HG changeset patch
  5. # User Alain Leufroy
  6. # Date 1541695757 -3600
  7. # Node ID ae6b1ba7482963bc9de51f299891e99005794e4e
  8. # Parent 6ae26ba7b928019e48dd1c73358c18d6dd2d86f3
  9. compat: fix for hg 4.8
  10. 089fc0db0954 introduced a new `createopts` parameter.
  11. `hggit` does not support repository creation, so we can just ignore
  12. it.
  13. diff --git a/hggit/gitrepo.py b/hggit/gitrepo.py
  14. --- a/hggit/gitrepo.py
  15. +++ b/hggit/gitrepo.py
  16. @@ -13,7 +13,7 @@
  17. class gitrepo(peerrepository):
  18. - def __init__(self, ui, path, create, intents=None):
  19. + def __init__(self, ui, path, create, intents=None, **kwargs):
  20. if create: # pragma: no cover
  21. raise error.Abort('Cannot create a git repository.')
  22. self._ui = ui
  23. # HG changeset patch
  24. # User Kevin Bullock <kbullock@ringworld.org>
  25. # Date 1543713965 21600
  26. # Node ID 143b7511eadbea7507d847c805241a6db290ffe7
  27. # Parent ae6b1ba7482963bc9de51f299891e99005794e4e
  28. compat: glob some verify output that changed in hg 4.8
  29. diff --git a/tests/test-push-r.t b/tests/test-push-r.t
  30. --- a/tests/test-push-r.t
  31. +++ b/tests/test-push-r.t
  32. @@ -64,7 +64,7 @@
  33. checking manifests
  34. crosschecking files in changesets and manifests
  35. checking files
  36. - 1 files, 1 changesets, 1 total revisions
  37. + *1 changesets* (glob)
  38. pushing to test-1
  39. searching for changes
  40. adding changesets
  41. @@ -75,7 +75,7 @@
  42. checking manifests
  43. crosschecking files in changesets and manifests
  44. checking files
  45. - 1 files, 2 changesets, 2 total revisions
  46. + *2 changesets* (glob)
  47. pushing to test-2
  48. searching for changes
  49. adding changesets
  50. @@ -86,7 +86,7 @@
  51. checking manifests
  52. crosschecking files in changesets and manifests
  53. checking files
  54. - 1 files, 3 changesets, 3 total revisions
  55. + *3 changesets* (glob)
  56. pushing to test-3
  57. searching for changes
  58. adding changesets
  59. @@ -97,7 +97,7 @@
  60. checking manifests
  61. crosschecking files in changesets and manifests
  62. checking files
  63. - 1 files, 4 changesets, 4 total revisions
  64. + *4 changesets* (glob)
  65. pushing to test-4
  66. searching for changes
  67. adding changesets
  68. @@ -108,7 +108,7 @@
  69. checking manifests
  70. crosschecking files in changesets and manifests
  71. checking files
  72. - 1 files, 2 changesets, 2 total revisions
  73. + *2 changesets* (glob)
  74. pushing to test-5
  75. searching for changes
  76. adding changesets
  77. @@ -119,7 +119,7 @@
  78. checking manifests
  79. crosschecking files in changesets and manifests
  80. checking files
  81. - 1 files, 3 changesets, 3 total revisions
  82. + *3 changesets* (glob)
  83. pushing to test-6
  84. searching for changes
  85. adding changesets
  86. @@ -130,7 +130,7 @@
  87. checking manifests
  88. crosschecking files in changesets and manifests
  89. checking files
  90. - 2 files, 4 changesets, 5 total revisions
  91. + *4 changesets* (glob)
  92. pushing to test-7
  93. searching for changes
  94. adding changesets
  95. @@ -141,7 +141,7 @@
  96. checking manifests
  97. crosschecking files in changesets and manifests
  98. checking files
  99. - 3 files, 5 changesets, 6 total revisions
  100. + *5 changesets* (glob)
  101. pushing to test-8
  102. searching for changes
  103. adding changesets
  104. @@ -152,7 +152,7 @@
  105. checking manifests
  106. crosschecking files in changesets and manifests
  107. checking files
  108. - 2 files, 5 changesets, 5 total revisions
  109. + *5 changesets* (glob)
  110. $ cd test-8
  111. $ hg pull ../test-7
  112. pulling from ../test-7
  113. @@ -168,4 +168,4 @@
  114. checking manifests
  115. crosschecking files in changesets and manifests
  116. checking files
  117. - 4 files, 9 changesets, 7 total revisions
  118. + *9 changesets* (glob)
  119. # HG changeset patch
  120. # User Kevin Bullock <kbullock@ringworld.org>
  121. # Date 1543713996 21600
  122. # Node ID 8d00fde45adbc6c3c0ccab8e362b5f5c36c171e6
  123. # Parent 143b7511eadbea7507d847c805241a6db290ffe7
  124. compat: update how we register gitnode template keyword
  125. diff --git a/hggit/__init__.py b/hggit/__init__.py
  126. --- a/hggit/__init__.py
  127. +++ b/hggit/__init__.py
  128. @@ -94,9 +94,11 @@
  129. command = registrar.command(cmdtable)
  130. configitem = registrar.configitem(configtable)
  131. compat.registerconfigs(configitem)
  132. + templatekeyword = registrar.templatekeyword()
  133. except (ImportError, AttributeError):
  134. command = cmdutil.command(cmdtable)
  135. + templatekeyword = compat.templatekeyword()
  136. # support for `hg clone git://github.com/defunkt/facebox.git`
  137. # also hg clone git+ssh://git@github.com/schacon/simplegit.git
  138. @@ -207,7 +209,6 @@
  139. def extsetup(ui):
  140. - templatekw.keywords.update({'gitnode': gitnodekw})
  141. revset.symbols.update({
  142. 'fromgit': revset_fromgit, 'gitnode': revset_gitnode
  143. })
  144. @@ -455,12 +456,30 @@
  145. raise LookupError(rev, git.map_file, _('ambiguous identifier'))
  146. -def gitnodekw(**args):
  147. - """:gitnode: String. The Git changeset identification hash, as a 40 hexadecimal
  148. -digit string."""
  149. - node = args['ctx']
  150. - repo = args['repo']
  151. +def _gitnodekw(node, repo):
  152. gitnode = repo.githandler.map_git_get(node.hex())
  153. if gitnode is None:
  154. gitnode = ''
  155. return gitnode
  156. +
  157. +
  158. +if (hgutil.safehasattr(templatekw, 'templatekeyword') and
  159. + hgutil.safehasattr(templatekw.templatekeyword._table['node'],
  160. + '_requires')):
  161. + @templatekeyword('gitnode', requires={'ctx', 'repo'})
  162. + def gitnodekw(context, mapping):
  163. + """:gitnode: String. The Git changeset identification hash, as a
  164. + 40 hexadecimal digit string."""
  165. + node = context.resource(mapping, 'ctx')
  166. + repo = context.resource(mapping, 'repo')
  167. + return _gitnodekw(node, repo)
  168. +
  169. +else:
  170. + # COMPAT: hg < 4.6 - templatekeyword API changed
  171. + @templatekeyword('gitnode')
  172. + def gitnodekw(**args):
  173. + """:gitnode: String. The Git changeset identification hash, as a
  174. + 40 hexadecimal digit string."""
  175. + node = args['ctx']
  176. + repo = args['repo']
  177. + return _gitnodekw(node, repo)
  178. diff --git a/hggit/compat.py b/hggit/compat.py
  179. --- a/hggit/compat.py
  180. +++ b/hggit/compat.py
  181. @@ -2,6 +2,7 @@
  182. bookmarks,
  183. context,
  184. phases,
  185. + templatekw,
  186. url,
  187. util as hgutil,
  188. )
  189. @@ -192,3 +193,14 @@
  190. if hasconfigitems:
  191. return getconfig(section, item)
  192. return getconfig(section, item, CONFIG_DEFAULTS[section][item])
  193. +
  194. +
  195. +class templatekeyword(object):
  196. + def __init__(self):
  197. + self._table = {}
  198. +
  199. + def __call__(self, name):
  200. + def decorate(func):
  201. + templatekw.keywords.update({name: func})
  202. + return func
  203. + return decorate