Merge lp:~jelmer/brz/cmp into lp:brz

Proposed by Jelmer Vernooij
Status: Merged
Approved by: Jelmer Vernooij
Approved revision: 7644
Merge reported by: The Breezy Bot
Merged at revision: not available
Proposed branch: lp:~jelmer/brz/cmp
Merge into: lp:brz
Diff against target: 80 lines (+7/-16)
4 files modified
breezy/bzr/conflicts.py (+3/-6)
breezy/plugins/bash_completion/bashcomp.py (+0/-3)
breezy/plugins/zsh_completion/zshcomp.py (+1/-4)
breezy/transport/__init__.py (+3/-3)
To merge this branch: bzr merge lp:~jelmer/brz/cmp
Reviewer Review Type Date Requested Status
Jelmer Vernooij Approve
Review via email: mp+430343@code.launchpad.net

Commit message

Remove obsolete __cmp__.

Description of the change

Remove obsolete __cmp__.

To post a comment you must log in.
Revision history for this message
Jelmer Vernooij (jelmer) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'breezy/bzr/conflicts.py'
2--- breezy/bzr/conflicts.py 2022-08-22 18:19:46 +0000
3+++ breezy/bzr/conflicts.py 2022-09-22 23:23:14 +0000
4@@ -68,19 +68,16 @@
5 def _cmp_list(self):
6 return [self.typestring, self.path, self.file_id]
7
8- def __cmp__(self, other):
9+ def __eq__(self, other):
10 if getattr(other, "_cmp_list", None) is None:
11- return -1
12+ return False
13 x = self._cmp_list()
14 y = other._cmp_list()
15- return (x > y) - (x < y)
16+ return x == y
17
18 def __hash__(self):
19 return hash((type(self), self.path, self.file_id))
20
21- def __eq__(self, other):
22- return self.__cmp__(other) == 0
23-
24 def __ne__(self, other):
25 return not self.__eq__(other)
26
27
28=== modified file 'breezy/plugins/bash_completion/bashcomp.py'
29--- breezy/plugins/bash_completion/bashcomp.py 2021-01-10 00:25:52 +0000
30+++ breezy/plugins/bash_completion/bashcomp.py 2022-09-22 23:23:14 +0000
31@@ -278,9 +278,6 @@
32 def __str__(self):
33 return self.name
34
35- def __cmp__(self, other):
36- return cmp(self.name, other.name)
37-
38 def __lt__(self, other):
39 return self.name < other.name
40
41
42=== modified file 'breezy/plugins/zsh_completion/zshcomp.py'
43--- breezy/plugins/zsh_completion/zshcomp.py 2021-01-10 00:25:52 +0000
44+++ breezy/plugins/zsh_completion/zshcomp.py 2022-09-22 23:23:14 +0000
45@@ -120,9 +120,6 @@
46 def __str__(self):
47 return self.name
48
49- def __cmp__(self, other):
50- return cmp(self.name, other.name)
51-
52 def __lt__(self, other):
53 return self.name < other.name
54
55@@ -255,7 +252,7 @@
56 the completion key (usually tab).
57
58 Commonly used like this:
59- eval "`brz zsh -completion`"
60+ eval "`brz zsh-completion`"
61 """
62
63 takes_options = [
64
65=== modified file 'breezy/transport/__init__.py'
66--- breezy/transport/__init__.py 2022-08-22 18:19:46 +0000
67+++ breezy/transport/__init__.py 2022-09-22 23:23:14 +0000
68@@ -200,9 +200,9 @@
69 self.length = length
70 self.ranges = ranges
71
72- def __cmp__(self, other):
73- return cmp((self.start, self.length, self.ranges),
74- (other.start, other.length, other.ranges))
75+ def __lt__(self, other):
76+ return ((self.start, self.length, self.ranges) <
77+ (other.start, other.length, other.ranges))
78
79 def __eq__(self, other):
80 return ((self.start, self.length, self.ranges) ==

Subscribers

People subscribed via source and target branches