From 86aafebb6deabbf5183906f4c0c79dade410ed95 Mon Sep 17 00:00:00 2001 From: Nico von Geyso Date: Mon, 20 May 2013 15:13:04 +0200 Subject: [PATCH] Fixed: remove OrderedDict for compability reasons (python2.6) --- pygit2/repository.py | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/pygit2/repository.py b/pygit2/repository.py index 6a5ec38..bf0e835 100644 --- a/pygit2/repository.py +++ b/pygit2/repository.py @@ -27,7 +27,6 @@ # Import from the Standard Library from string import hexdigits -from collections import OrderedDict # Import from pygit2 from _pygit2 import Repository as _Repository @@ -193,26 +192,23 @@ class Repository(_Repository): a = treeish_to_tree(a) or a b = treeish_to_tree(b) or b - opts = OrderedDict([ - ('flags', flags), - ('context_lines', context_lines), - ('interhunk_lines', interhunk_lines) - ]) + opt_keys = ['flags', 'context_lines', 'interhunk_lines'] + opt_values = [flags, context_lines, interhunk_lines] # Case 1: Diff tree to tree if isinstance(a, Tree) and isinstance(b, Tree): - return a.diff_to_tree(b, **opts) + return a.diff_to_tree(b, **dict(zip(opt_keys, opt_values))) # Case 2: Index to workdir elif a is None and b is None: - return self.index.diff_to_workdir(*opts.values()) + return self.index.diff_to_workdir(*opt_values) # Case 3: Diff tree to index or workdir elif isinstance(a, Tree) and b is None: if cached: - return a.diff_to_index(self.index, **opts) + return a.diff_to_index(self.index, *opt_values) else: - return a.diff_to_workdir(*opts.values()) + return a.diff_to_workdir(*opt_values) # Case 4: Diff blob to blob if isinstance(a, Blob) and isinstance(b, Blob):