Mercurial > hg > hg-git
diff hggit/git_handler.py @ 760:eb9ebc7ed061
git_handler: store hg extra data in git deterministically by sorting it
Previously, we'd iterate over the extra elements in arbitrary order. We now
sort the elements and store them in deterministic order.
Without sorting, the included test fails half the time.
author | Siddharth Agarwal <sid0@fb.com> |
---|---|
date | Sun, 31 Aug 2014 05:13:39 -0700 (2014-08-31) |
parents | 1d16139b8e50 |
children | 13a3513f8e67 |
line wrap: on
line diff
--- a/hggit/git_handler.py +++ b/hggit/git_handler.py @@ -586,7 +586,9 @@ for oldfile, newfile in renames: extra_message += "rename : " + oldfile + " => " + newfile + "\n" - for key, value in extra.iteritems(): + extraitems = extra.items() + extraitems.sort() + for key, value in extraitems: if key in ('author', 'committer', 'encoding', 'message', 'branch', 'hg-git'): continue else: