summaryrefslogtreecommitdiff
path: root/dev-vcs/hg-git/files/hg-git-0.8.12-hg-4.8.patch
blob: c456ce53c740adceaeee0417edbddfdf6888e708 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
https://bitbucket.org/durin42/hg-git/commits/ae6b1ba7482963bc9de51f299891e99005794e4e/raw
https://bitbucket.org/durin42/hg-git/commits/143b7511eadbea7507d847c805241a6db290ffe7/raw
https://bitbucket.org/durin42/hg-git/commits/8d00fde45adbc6c3c0ccab8e362b5f5c36c171e6/raw

# HG changeset patch
# User Alain Leufroy
# Date 1541695757 -3600
# Node ID ae6b1ba7482963bc9de51f299891e99005794e4e
# Parent  6ae26ba7b928019e48dd1c73358c18d6dd2d86f3
compat: fix for hg 4.8

089fc0db0954 introduced a new `createopts` parameter.

`hggit` does not support repository creation, so we can just ignore
it.

diff --git a/hggit/gitrepo.py b/hggit/gitrepo.py
--- a/hggit/gitrepo.py
+++ b/hggit/gitrepo.py
@@ -13,7 +13,7 @@
 
 
 class gitrepo(peerrepository):
-    def __init__(self, ui, path, create, intents=None):
+    def __init__(self, ui, path, create, intents=None, **kwargs):
         if create:  # pragma: no cover
             raise error.Abort('Cannot create a git repository.')
         self._ui = ui

# HG changeset patch
# User Kevin Bullock <kbullock@ringworld.org>
# Date 1543713965 21600
# Node ID 143b7511eadbea7507d847c805241a6db290ffe7
# Parent  ae6b1ba7482963bc9de51f299891e99005794e4e
compat: glob some verify output that changed in hg 4.8

diff --git a/tests/test-push-r.t b/tests/test-push-r.t
--- a/tests/test-push-r.t
+++ b/tests/test-push-r.t
@@ -64,7 +64,7 @@
   checking manifests
   crosschecking files in changesets and manifests
   checking files
-  1 files, 1 changesets, 1 total revisions
+  *1 changesets* (glob)
   pushing to test-1
   searching for changes
   adding changesets
@@ -75,7 +75,7 @@
   checking manifests
   crosschecking files in changesets and manifests
   checking files
-  1 files, 2 changesets, 2 total revisions
+  *2 changesets* (glob)
   pushing to test-2
   searching for changes
   adding changesets
@@ -86,7 +86,7 @@
   checking manifests
   crosschecking files in changesets and manifests
   checking files
-  1 files, 3 changesets, 3 total revisions
+  *3 changesets* (glob)
   pushing to test-3
   searching for changes
   adding changesets
@@ -97,7 +97,7 @@
   checking manifests
   crosschecking files in changesets and manifests
   checking files
-  1 files, 4 changesets, 4 total revisions
+  *4 changesets* (glob)
   pushing to test-4
   searching for changes
   adding changesets
@@ -108,7 +108,7 @@
   checking manifests
   crosschecking files in changesets and manifests
   checking files
-  1 files, 2 changesets, 2 total revisions
+  *2 changesets* (glob)
   pushing to test-5
   searching for changes
   adding changesets
@@ -119,7 +119,7 @@
   checking manifests
   crosschecking files in changesets and manifests
   checking files
-  1 files, 3 changesets, 3 total revisions
+  *3 changesets* (glob)
   pushing to test-6
   searching for changes
   adding changesets
@@ -130,7 +130,7 @@
   checking manifests
   crosschecking files in changesets and manifests
   checking files
-  2 files, 4 changesets, 5 total revisions
+  *4 changesets* (glob)
   pushing to test-7
   searching for changes
   adding changesets
@@ -141,7 +141,7 @@
   checking manifests
   crosschecking files in changesets and manifests
   checking files
-  3 files, 5 changesets, 6 total revisions
+  *5 changesets* (glob)
   pushing to test-8
   searching for changes
   adding changesets
@@ -152,7 +152,7 @@
   checking manifests
   crosschecking files in changesets and manifests
   checking files
-  2 files, 5 changesets, 5 total revisions
+  *5 changesets* (glob)
   $ cd test-8
   $ hg pull ../test-7
   pulling from ../test-7
@@ -168,4 +168,4 @@
   checking manifests
   crosschecking files in changesets and manifests
   checking files
-  4 files, 9 changesets, 7 total revisions
+  *9 changesets* (glob)

# HG changeset patch
# User Kevin Bullock <kbullock@ringworld.org>
# Date 1543713996 21600
# Node ID 8d00fde45adbc6c3c0ccab8e362b5f5c36c171e6
# Parent  143b7511eadbea7507d847c805241a6db290ffe7
compat: update how we register gitnode template keyword

diff --git a/hggit/__init__.py b/hggit/__init__.py
--- a/hggit/__init__.py
+++ b/hggit/__init__.py
@@ -94,9 +94,11 @@
     command = registrar.command(cmdtable)
     configitem = registrar.configitem(configtable)
     compat.registerconfigs(configitem)
+    templatekeyword = registrar.templatekeyword()
 
 except (ImportError, AttributeError):
     command = cmdutil.command(cmdtable)
+    templatekeyword = compat.templatekeyword()
 
 # support for `hg clone git://github.com/defunkt/facebox.git`
 # also hg clone git+ssh://git@github.com/schacon/simplegit.git
@@ -207,7 +209,6 @@
 
 
 def extsetup(ui):
-    templatekw.keywords.update({'gitnode': gitnodekw})
     revset.symbols.update({
         'fromgit': revset_fromgit, 'gitnode': revset_gitnode
     })
@@ -455,12 +456,30 @@
     raise LookupError(rev, git.map_file, _('ambiguous identifier'))
 
 
-def gitnodekw(**args):
-    """:gitnode: String. The Git changeset identification hash, as a 40 hexadecimal
-digit string."""
-    node = args['ctx']
-    repo = args['repo']
+def _gitnodekw(node, repo):
     gitnode = repo.githandler.map_git_get(node.hex())
     if gitnode is None:
         gitnode = ''
     return gitnode
+
+
+if (hgutil.safehasattr(templatekw, 'templatekeyword') and
+        hgutil.safehasattr(templatekw.templatekeyword._table['node'],
+                           '_requires')):
+    @templatekeyword('gitnode', requires={'ctx', 'repo'})
+    def gitnodekw(context, mapping):
+        """:gitnode: String. The Git changeset identification hash, as a
+        40 hexadecimal digit string."""
+        node = context.resource(mapping, 'ctx')
+        repo = context.resource(mapping, 'repo')
+        return _gitnodekw(node, repo)
+
+else:
+    # COMPAT: hg < 4.6 - templatekeyword API changed
+    @templatekeyword('gitnode')
+    def gitnodekw(**args):
+        """:gitnode: String. The Git changeset identification hash, as a
+        40 hexadecimal digit string."""
+        node = args['ctx']
+        repo = args['repo']
+        return _gitnodekw(node, repo)
diff --git a/hggit/compat.py b/hggit/compat.py
--- a/hggit/compat.py
+++ b/hggit/compat.py
@@ -2,6 +2,7 @@
     bookmarks,
     context,
     phases,
+    templatekw,
     url,
     util as hgutil,
 )
@@ -192,3 +193,14 @@
     if hasconfigitems:
         return getconfig(section, item)
     return getconfig(section, item, CONFIG_DEFAULTS[section][item])
+
+
+class templatekeyword(object):
+    def __init__(self):
+        self._table = {}
+
+    def __call__(self, name):
+        def decorate(func):
+            templatekw.keywords.update({name: func})
+            return func
+        return decorate