mirror of
https://github.com/facebook/sapling.git
synced 2024-10-09 16:31:02 +03:00
fastannotate: improve compatibility with older hg
Summary: Before ba91edc29ce5, `diffopts` does not have `__dict__`. Let's fix that by querying keys from `diffopts.default`, instead of using `__dict__`. Test Plan: `arc unit` Reviewers: #sourcecontrol, stash Reviewed By: stash Subscribers: mjpieters Differential Revision: https://phabricator.intern.facebook.com/D4086921 Signature: t1:4086921:1477554146:e48647c59769c2951518b091350289aa966aab7b
This commit is contained in:
parent
3339323a30
commit
79b9423cee
@ -132,7 +132,10 @@ def encodedir(path):
|
||||
.replace('.lock/', '.lock.hg/'))
|
||||
|
||||
def hashdiffopts(diffopts):
|
||||
diffoptstr = str(sorted(diffopts.__dict__.iteritems()))
|
||||
diffoptstr = str(sorted(
|
||||
(k, getattr(diffopts, k))
|
||||
for k in mdiff.diffopts.defaults.iterkeys()
|
||||
))
|
||||
return hashlib.sha1(diffoptstr).hexdigest()[:6]
|
||||
|
||||
_defaultdiffopthash = hashdiffopts(mdiff.defaultopts)
|
||||
|
Loading…
Reference in New Issue
Block a user