##// END OF EJS Templates
phabricator: handle local:commits time being string or int...
Ian Moody -
r42824:c9be100e default draft
parent child Browse files
Show More
@@ -950,7 +950,7 b' def getdiffmeta(diff):'
950 meta[b'user'] = b'%s <%s>' % (commit[b'author'],
950 meta[b'user'] = b'%s <%s>' % (commit[b'author'],
951 commit[b'authorEmail'])
951 commit[b'authorEmail'])
952 if b'time' in commit:
952 if b'time' in commit:
953 meta[b'date'] = b'%d 0' % commit[b'time']
953 meta[b'date'] = b'%d 0' % int(commit[b'time'])
954 if b'branch' in commit:
954 if b'branch' in commit:
955 meta[b'branch'] = commit[b'branch']
955 meta[b'branch'] = commit[b'branch']
956 node = commit.get(b'commit', commit.get(b'rev'))
956 node = commit.get(b'commit', commit.get(b'rev'))
@@ -132,47 +132,22 b' Commenting when phabsending:'
132 D1253 - updated - 1acd4b60af38: create comment for phabricator test
132 D1253 - updated - 1acd4b60af38: create comment for phabricator test
133
133
134 Phabreading a DREV with a local:commits time as a string:
134 Phabreading a DREV with a local:commits time as a string:
135 BROKEN: shouldn't error
136 $ hg phabread --test-vcr "$VCR/phabread-str-time.json" D1285
135 $ hg phabread --test-vcr "$VCR/phabread-str-time.json" D1285
137 ** unknown exception encountered, please report by visiting
136 # HG changeset patch
138 ** https://mercurial-scm.org/wiki/BugTracker
137 # User test <test>
139 ** Python * (glob)
138 # Date 1562019844 0
140 ** Mercurial Distributed SCM (version *) (glob)
139 # Branch default
141 ** Extensions loaded: phabricator
140 # Node ID da5c8c6bf23a36b6e3af011bc3734460692c23ce
142 Traceback (most recent call last):
141 # Parent 1f634396406d03e565ed645370e5fecd062cf215
143 File "*/install/bin/hg", line *, in <module> (glob)
142 test string time
144 dispatch.run()
143
145 File "*/install/lib/python/mercurial/dispatch.py", line *, in run (glob)
144 Differential Revision: https://phab.mercurial-scm.org/D1285
146 status = dispatch(req)
145 diff --git a/test b/test
147 File "*/install/lib/python/mercurial/dispatch.py", line *, in dispatch (glob)
146 new file mode 100644
148 ret = _runcatch(req) or 0
147 --- /dev/null
149 File "*/install/lib/python/mercurial/dispatch.py", line *, in _runcatch (glob)
148 +++ b/test
150 return _callcatch(ui, _runcatchfunc)
149 @@ * @@ (glob)
151 File "*/install/lib/python/mercurial/dispatch.py", line *, in _callcatch (glob)
150 +test
152 return scmutil.callcatch(ui, func)
151
153 File "*/install/lib/python/mercurial/scmutil.py", line *, in callcatch (glob)
154 return func()
155 File "*/install/lib/python/mercurial/dispatch.py", line *, in _runcatchfunc (glob)
156 return _dispatch(req)
157 File "*/install/lib/python/mercurial/dispatch.py", line *, in _dispatch (glob)
158 cmdpats, cmdoptions)
159 File "*/install/lib/python/mercurial/dispatch.py", line *, in runcommand (glob)
160 ret = _runcommand(ui, options, cmd, d)
161 File "*/install/lib/python/mercurial/dispatch.py", line *, in _runcommand (glob)
162 return cmdfunc()
163 File "*/install/lib/python/mercurial/dispatch.py", line *, in <lambda> (glob)
164 d = lambda: util.checksignature(func)(ui, *args, **strcmdopt)
165 File "*/install/lib/python/mercurial/util.py", line *, in check (glob)
166 return func(*args, **kwargs)
167 File "*/install/lib/python/hgext/phabricator.py", line *, in inner (glob)
168 return fn(*args, **kwargs)
169 File "*/install/lib/python/hgext/phabricator.py", line *, in phabread (glob)
170 readpatch(repo, drevs, ui.write)
171 File "*/install/lib/python/hgext/phabricator.py", line *, in readpatch (glob)
172 meta = getdiffmeta(diffs[b'%d' % diffid])
173 File "*/install/lib/python/hgext/phabricator.py", line *, in getdiffmeta (glob)
174 meta[b'date'] = b'%d 0' % commit[b'time']
175 TypeError: %d format: a number is required, not str
176 [1]
177
152
178 $ cd ..
153 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now