##// 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 950 meta[b'user'] = b'%s <%s>' % (commit[b'author'],
951 951 commit[b'authorEmail'])
952 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 954 if b'branch' in commit:
955 955 meta[b'branch'] = commit[b'branch']
956 956 node = commit.get(b'commit', commit.get(b'rev'))
@@ -132,47 +132,22 b' Commenting when phabsending:'
132 132 D1253 - updated - 1acd4b60af38: create comment for phabricator test
133 133
134 134 Phabreading a DREV with a local:commits time as a string:
135 BROKEN: shouldn't error
136 135 $ hg phabread --test-vcr "$VCR/phabread-str-time.json" D1285
137 ** unknown exception encountered, please report by visiting
138 ** https://mercurial-scm.org/wiki/BugTracker
139 ** Python * (glob)
140 ** Mercurial Distributed SCM (version *) (glob)
141 ** Extensions loaded: phabricator
142 Traceback (most recent call last):
143 File "*/install/bin/hg", line *, in <module> (glob)
144 dispatch.run()
145 File "*/install/lib/python/mercurial/dispatch.py", line *, in run (glob)
146 status = dispatch(req)
147 File "*/install/lib/python/mercurial/dispatch.py", line *, in dispatch (glob)
148 ret = _runcatch(req) or 0
149 File "*/install/lib/python/mercurial/dispatch.py", line *, in _runcatch (glob)
150 return _callcatch(ui, _runcatchfunc)
151 File "*/install/lib/python/mercurial/dispatch.py", line *, in _callcatch (glob)
152 return scmutil.callcatch(ui, func)
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]
136 # HG changeset patch
137 # User test <test>
138 # Date 1562019844 0
139 # Branch default
140 # Node ID da5c8c6bf23a36b6e3af011bc3734460692c23ce
141 # Parent 1f634396406d03e565ed645370e5fecd062cf215
142 test string time
143
144 Differential Revision: https://phab.mercurial-scm.org/D1285
145 diff --git a/test b/test
146 new file mode 100644
147 --- /dev/null
148 +++ b/test
149 @@ * @@ (glob)
150 +test
151
177 152
178 153 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now