[meld] Handle Bazaar conflict status
- From: Kai Willadsen <kaiw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [meld] Handle Bazaar conflict status
- Date: Tue, 11 Dec 2012 20:54:35 +0000 (UTC)
commit 1d86f50b5591af656d5977bea561c0efed322334
Author: Kai Willadsen <kai willadsen gmail com>
Date: Tue Dec 11 06:13:15 2012 +1000
Handle Bazaar conflict status
Because Bazaar doesn't actually specify conflict statuses on the same
line as other statuses, we need to explicitly cope with the extra
conflict status listing. This patch adds a hacky regex-based workaround
that rewrites conflict status lines and updates Meld's path-state map
accordingly.
meld/vc/bzr.py | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/meld/vc/bzr.py b/meld/vc/bzr.py
index de16784..92fa820 100644
--- a/meld/vc/bzr.py
+++ b/meld/vc/bzr.py
@@ -36,6 +36,7 @@ class Vc(_vc.CachedVc):
NAME = "Bazaar"
VC_DIR = ".bzr"
PATCH_INDEX_RE = "^=== modified file '(.*)'.*$"
+ CONFLICT_RE = "conflict in (.*)$"
# We use None here to indicate flags that we don't deal with or care about
state_1_map = {
@@ -95,14 +96,20 @@ class Vc(_vc.CachedVc):
raise
tree_state = {}
for entry in entries:
- state_string, name = entry[:3], entry[4:]
+ state_string, name = entry[:3], entry[4:].strip()
if not re.match(self.valid_status_re, state_string):
continue
# TODO: We don't do anything with exec bit changes.
- path = os.path.join(branch_root, name.strip())
state = self.state_1_map.get(state_string[0], None)
if state is None:
state = self.state_2_map.get(state_string[1], _vc.STATE_NORMAL)
+ elif state == _vc.STATE_CONFLICT:
+ real_path_match = re.search(self.CONFLICT_RE, name)
+ if real_path_match is None:
+ continue
+ name = real_path_match.group(1)
+
+ path = os.path.join(branch_root, name)
tree_state[path] = state
return tree_state
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]