changeset 674:a51e50d943b2

svnwrap: use decorator syntax for properties. The original reason not to use property syntax was that it didn't work with Python 2.3. Mercurial dropped support for it more than a year ago... No functionality change.
author Dan Villiom Podlaski Christiansen <danchr@gmail.com>
date Wed, 11 Aug 2010 19:57:35 +0200
parents 32089d080ff8
children 31cd9f41ec09
files hgsubversion/svnwrap/common.py hgsubversion/svnwrap/svn_swig_wrapper.py
diffstat 2 files changed, 12 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/hgsubversion/svnwrap/common.py
+++ b/hgsubversion/svnwrap/common.py
@@ -56,25 +56,25 @@ class Revision(tuple):
         return tuple.__new__(self,
                              (revnum, author, message, date, _paths))
 
-    def get_revnum(self):
+    @property
+    def revnum(self):
         return self[0]
-    revnum = property(get_revnum)
 
-    def get_author(self):
+    @property
+    def author(self):
         return self[1]
-    author = property(get_author)
 
-    def get_message(self):
+    @property
+    def message(self):
         return self[2]
-    message = property(get_message)
 
-    def get_date(self):
+    @property
+    def date(self):
         return self[3]
-    date = property(get_date)
 
-    def get_paths(self):
+    @property
+    def paths(self):
         return self[4]
-    paths = property(get_paths)
 
     def __str__(self):
         return 'r%d by %s' % (self.revnum, self.author)
--- a/hgsubversion/svnwrap/svn_swig_wrapper.py
+++ b/hgsubversion/svnwrap/svn_swig_wrapper.py
@@ -224,10 +224,11 @@ class SubversionRepo(object):
                         break
             raise common.SubversionConnectionException(msg)
 
+    @property
     def HEAD(self):
         return ra.get_latest_revnum(self.ra, self.pool)
-    HEAD = property(HEAD)
 
+    @property
     def last_changed_rev(self):
         try:
             holder = []
@@ -246,7 +247,6 @@ class SubversionRepo(object):
                 raise
             else:
                 return self.HEAD
-    last_changed_rev = property(last_changed_rev)
 
     def list_dir(self, dir, revision=None):
         """List the contents of a server-side directory.