[meld] Simplify code in _command_iter()'s relpath()
- From: Vincent Legoll <vincele src gnome org>
- To: svn-commits-list gnome org
- Subject: [meld] Simplify code in _command_iter()'s relpath()
- Date: Mon, 27 Apr 2009 15:49:54 -0400 (EDT)
commit 384d84e342161fffc7bb9abd86e25fcec97c7502
Author: Vincent Legoll <vincent legoll gmail com>
Date: Mon Apr 27 21:48:40 2009 +0200
Simplify code in _command_iter()'s relpath()
---
vcview.py | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/vcview.py b/vcview.py
index abff0e4..434790e 100644
--- a/vcview.py
+++ b/vcview.py
@@ -401,8 +401,8 @@ class VcView(melddoc.MeldDoc, gnomeglade.Component):
yield "[%s] %s" % (self.label_text, msg.replace("\n", u"\u21b2") )
def relpath(pbase, p):
kill = 0
- if p.startswith(pbase):
- kill = len(pbase) and (len(pbase)+1) or 0
+ if len(pbase) and p.startswith(pbase):
+ kill = len(pbase) + 1
return p[kill:] or "."
if len(files) == 1 and os.path.isdir(files[0]):
workdir = self.vc.get_working_directory(files[0])
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]