[meld] matchers.merge: Reformat a bad commented block
- From: Kai Willadsen <kaiw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [meld] matchers.merge: Reformat a bad commented block
- Date: Sun, 31 Dec 2017 20:13:35 +0000 (UTC)
commit e9087479ce04758d471f1f9117e5136fdcd6711c
Author: Kai Willadsen <kai willadsen gmail com>
Date: Sun Dec 17 06:37:51 2017 +1000
matchers.merge: Reformat a bad commented block
This looks wild, but it's just fixing a bad comment formatting
meld/matchers/merge.py | 42 ++++++++++++++++++++++--------------------
1 file changed, 22 insertions(+), 20 deletions(-)
---
diff --git a/meld/matchers/merge.py b/meld/matchers/merge.py
index c9b2bcb4..8504c2df 100644
--- a/meld/matchers/merge.py
+++ b/meld/matchers/merge.py
@@ -56,26 +56,28 @@ class AutoMergeDiffer(diffutil.Differ):
out1 = ('conflict', s1, e1, l2 + chunk[3], l2 + chunk[4])
yield out0, out1
return
-# elif len0 > 0 and len2 > 0:
- # this logic will resolve more conflicts automatically, but unresolved conflicts may
sometimes look confusing
- # as the line numbers in ancestor file will be interpolated and may not reflect the
actual changes
-# matcher = self._matcher(None, texts[0][l0:h0], texts[2][l2:h2])
-# if len0 > len2:
-# maxindex = 1
-# maxlen = len0
-# else:
-# maxindex = 3
-# maxlen = len2
-# for chunk in matcher.get_opcodes():
-# if chunk[0] == 'equal':
-# out0 = ('replace', l1 + len1 * chunk[maxindex] / maxlen, l1 + len1 *
chunk[maxindex + 1] / maxlen, l0 + chunk[1], l0 + chunk[2])
-# out1 = ('replace', l1 + len1 * chunk[maxindex] / maxlen, l1 + len1 *
chunk[maxindex + 1] / maxlen, l2 + chunk[3], l2 + chunk[4])
-# yield out0, out1
-# else:
-# out0 = ('conflict', l1 + len1 * chunk[maxindex] / maxlen, l1 + len1 *
chunk[maxindex + 1] / maxlen, l0 + chunk[1], l0 + chunk[2])
-# out1 = ('conflict', l1 + len1 * chunk[maxindex] / maxlen, l1 + len1 *
chunk[maxindex + 1] / maxlen, l2 + chunk[3], l2 + chunk[4])
-# yield out0, out1
-# return
+ # elif len0 > 0 and len2 > 0:
+ # # this logic will resolve more conflicts automatically,
+ # # but unresolved conflicts may sometimes look confusing
+ # # as the line numbers in ancestor file will be
+ # # interpolated and may not reflect the actual changes
+ # matcher = self._matcher(None, texts[0][l0:h0], texts[2][l2:h2])
+ # if len0 > len2:
+ # maxindex = 1
+ # maxlen = len0
+ # else:
+ # maxindex = 3
+ # maxlen = len2
+ # for chunk in matcher.get_opcodes():
+ # if chunk[0] == 'equal':
+ # out0 = ('replace', l1 + len1 * chunk[maxindex] / maxlen, l1 + len1 *
chunk[maxindex + 1] / maxlen, l0 + chunk[1], l0 + chunk[2])
+ # out1 = ('replace', l1 + len1 * chunk[maxindex] / maxlen, l1 + len1 *
chunk[maxindex + 1] / maxlen, l2 + chunk[3], l2 + chunk[4])
+ # yield out0, out1
+ # else:
+ # out0 = ('conflict', l1 + len1 * chunk[maxindex] / maxlen, l1 + len1 *
chunk[maxindex + 1] / maxlen, l0 + chunk[1], l0 + chunk[2])
+ # out1 = ('conflict', l1 + len1 * chunk[maxindex] / maxlen, l1 + len1 *
chunk[maxindex + 1] / maxlen, l2 + chunk[3], l2 + chunk[4])
+ # yield out0, out1
+ # return
else:
# some tricks to resolve even more conflicts automatically
# unfortunately the resulting chunks cannot be used to
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]