Skip to content

Commit d35f45a

Browse files
authored
Bitbucket Cloud: Diffstat has more possibles states (#940)
Conflicts due to file deletion and file rename were not convered, yet. According to my tests conflicts due to file addition get marked as "merge conflict". Signed-off-by: Frank Lichtenheld <[email protected]>
1 parent 7f8bc5a commit d35f45a

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

atlassian/bitbucket/cloud/repositories/diffstat.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@ class DiffStat(BitbucketCloudBase):
1313
MODIFIED = "modified"
1414
ADDED = "added"
1515
REMOVED = "removed"
16+
LOCAL_DELETED = "local deleted"
17+
REMOTE_DELETED = "remote deleted"
1618
MERGE_CONFLICT = "merge conflict"
19+
RENAME_CONFLICT = "rename conflict"
20+
RENAME_DELETE_CONFLICT = "rename/delete conflict"
1721
SUBREPO_CONFLICT = "subrepo conflict"
1822

1923
def __init__(self, data, *args, **kwargs):
@@ -43,7 +47,14 @@ def new(self):
4347
@property
4448
def has_conflict(self):
4549
"""True if the change causes a conflict."""
46-
return str(self.get_data("status")) in (self.MERGE_CONFLICT, self.SUBREPO_CONFLICT)
50+
return str(self.get_data("status")) in [
51+
self.MERGE_CONFLICT,
52+
self.RENAME_CONFLICT,
53+
self.RENAME_DELETE_CONFLICT,
54+
self.SUBREPO_CONFLICT,
55+
self.LOCAL_DELETED,
56+
self.REMOTE_DELETED,
57+
]
4758

4859

4960
class CommitFile(BitbucketCloudBase):

0 commit comments

Comments
 (0)