Commit 1b8cf511 authored by Christophe Dumez's avatar Christophe Dumez

- Big code clean up and optimisation

- added support for several working copies (usefull for bt in products)
note: Big code changes and small new bugs might have appeared


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@6847 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 420d2ea5
...@@ -206,13 +206,6 @@ try: ...@@ -206,13 +206,6 @@ try:
def getLogin(self, realm): def getLogin(self, realm):
return self.aq_parent._getLogin(realm) return self.aq_parent._getLogin(realm)
def _getPreferences(self):
working_path = self.getPortalObject().portal_preferences.getPreferredSubversionWorkingCopy()
if not working_path :
raise "Error: Please set Subversion working path in preferences"
#self.svn_username = self.getPortalObject().portal_preferences.getPreference('preferred_subversion_user_name')
os.chdir(working_path);
def getTimeout(self): def getTimeout(self):
return self.timeout return self.timeout
...@@ -226,7 +219,6 @@ try: ...@@ -226,7 +219,6 @@ try:
return self.exception return self.exception
def checkin(self, path, log_message, recurse): def checkin(self, path, log_message, recurse):
self._getPreferences()
try: try:
return self.client.checkin(path, log_message=log_message or 'none', recurse=recurse) return self.client.checkin(path, log_message=log_message or 'none', recurse=recurse)
except pysvn.ClientError, error: except pysvn.ClientError, error:
...@@ -237,7 +229,6 @@ try: ...@@ -237,7 +229,6 @@ try:
raise error raise error
def update(self, path): def update(self, path):
self._getPreferences()
try: try:
return self.client.update(path) return self.client.update(path)
except pysvn.ClientError, error: except pysvn.ClientError, error:
...@@ -252,7 +243,6 @@ try: ...@@ -252,7 +243,6 @@ try:
return [Status(x) for x in self.client.status(path, **kw)] return [Status(x) for x in self.client.status(path, **kw)]
def diff(self, path, revision1, revision2): def diff(self, path, revision1, revision2):
self._getPreferences()
tmp = mktemp() tmp = mktemp()
os.system('mkdir -p %s'%tmp) os.system('mkdir -p %s'%tmp)
if not revision1 or not revision2: if not revision1 or not revision2:
...@@ -264,11 +254,9 @@ try: ...@@ -264,11 +254,9 @@ try:
return diff return diff
def revert(self, path): def revert(self, path):
self._getPreferences()
return self.client.revert(path) return self.client.revert(path)
def log(self, path): def log(self, path):
self._getPreferences()
try: try:
log_list = self.client.log(path) log_list = self.client.log(path)
except pysvn.ClientError, error: except pysvn.ClientError, error:
...@@ -286,11 +274,9 @@ try: ...@@ -286,11 +274,9 @@ try:
return log_list return log_list
def add(self, path): def add(self, path):
self._getPreferences()
return self.client.add(path=path, force=True) return self.client.add(path=path, force=True)
def info(self, path): def info(self, path):
self._getPreferences()
try: try:
entry = self.client.info(path=path) entry = self.client.info(path=path)
except pysvn.ClientError, error: except pysvn.ClientError, error:
...@@ -308,7 +294,6 @@ try: ...@@ -308,7 +294,6 @@ try:
return entry_dict return entry_dict
def ls(self, path): def ls(self, path):
self._getPreferences()
try: try:
dict_list = self.client.ls(url_or_path=path, recurse=False) dict_list = self.client.ls(url_or_path=path, recurse=False)
except pysvn.ClientError, error: except pysvn.ClientError, error:
...@@ -326,11 +311,9 @@ try: ...@@ -326,11 +311,9 @@ try:
return dict_list return dict_list
def cleanup(self, path): def cleanup(self, path):
self._getPreferences()
return self.client.cleanup(path=path) return self.client.cleanup(path=path)
def remove(self, path): def remove(self, path):
self._getPreferences()
return self.client.remove(url_or_path=path, force=True) return self.client.remove(url_or_path=path, force=True)
def newSubversionClient(container, **kw): def newSubversionClient(container, **kw):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment