The function now returns immediately if the two arguments are the same
Python object, otherwise it compares the full path name (rather than
just the file name).
Discussion: https://groups.google.com/group/bup-list/browse_thread/thread/
1afc33b26394d69e/
1a7a8155a1005600
Signed-off-by: Gabriele Santilli <gabriele@colellachiara.com>
Reviewed-by: Rob Browning <rlb@defaultvalue.org>
self._subs = None
def __cmp__(a, b):
- return cmp(a and a.name or None, b and b.name or None)
+ if a is b:
+ return 0
+ return (cmp(a and a.parent, b and b.parent) or
+ cmp(a and a.name, b and b.name))
def __iter__(self):
return iter(self.subs())