Commit 27ea0c9d authored by Christophe Dumez's avatar Christophe Dumez

subversion improved a little

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@6545 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent d24e0903
...@@ -70,15 +70,22 @@ ...@@ -70,15 +70,22 @@
from Products.ERP5Subversion.SubversionClient import SubversionSSLTrustError, SubversionLoginError\n from Products.ERP5Subversion.SubversionClient import SubversionSSLTrustError, SubversionLoginError\n
\n \n
#return context.REQUEST\n
if "changelog" in context.REQUEST.keys():\n if "changelog" in context.REQUEST.keys():\n
changelog=context.REQUEST["changelog"]\n changelog=context.REQUEST["changelog"]\n
else:\n else:\n
changelog=None\n changelog=None\n
\n \n
to_commit = files.split(\',\')\n to_commit = files.split(\',\')\n
svn_path = context.getPortalObject().portal_preferences.getPreference(\'subversion_working_copy\')\n
if not svn_path :\n
raise "Error: Please set Subversion working path in preferences"\n
if svn_path[-1]!=\'/\':\n
svn_path+=\'/\'\n
\n \n
if to_commit != \'none\' :\n if to_commit != \'none\' :\n
for relative_path in to_commit:\n
relative_path = svn_path+relative_path\n
\n
try:\n try:\n
if not changelog :\n if not changelog :\n
return context.REQUEST.RESPONSE.redirect(context.absolute_url() + \'/BusinessTemplate_viewSvnChangelog?cancel_url=\'+context.absolute_url() + \'/\' + \'BusinessTemplate_viewSvnStatus?checked=\'+checked.replace(\'%20\',\'%2520\').replace(\' \',\'%20\')+\'&files=\'+files.replace(\'%20\',\'%2520\').replace(\' \',\'%20\'))\n return context.REQUEST.RESPONSE.redirect(context.absolute_url() + \'/BusinessTemplate_viewSvnChangelog?cancel_url=\'+context.absolute_url() + \'/\' + \'BusinessTemplate_viewSvnStatus?checked=\'+checked.replace(\'%20\',\'%2520\').replace(\' \',\'%20\')+\'&files=\'+files.replace(\'%20\',\'%2520\').replace(\' \',\'%20\'))\n
...@@ -148,6 +155,9 @@ return context.BusinessTemplate_viewSvnStatus()\n ...@@ -148,6 +155,9 @@ return context.BusinessTemplate_viewSvnStatus()\n
<string>changelog</string> <string>changelog</string>
<string>None</string> <string>None</string>
<string>to_commit</string> <string>to_commit</string>
<string>svn_path</string>
<string>_getiter_</string>
<string>relative_path</string>
<string>False</string> <string>False</string>
<string>error</string> <string>error</string>
<string>error1</string> <string>error1</string>
......
...@@ -68,6 +68,13 @@ ...@@ -68,6 +68,13 @@
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string encoding="cdata"><![CDATA[ <value> <string encoding="cdata"><![CDATA[
return context.REQUEST\n
svn_path = context.getPortalObject().portal_preferences.getPreference(\'subversion_working_copy\')\n
if not svn_path :\n
raise "Error: Please set Subversion working path in preferences"\n
if svn_path[-1]!=\'/\':\n
svn_path+=\'/\'\n
\n
#params modified,added,removed\n #params modified,added,removed\n
modified=context.REQUEST["modified"]\n modified=context.REQUEST["modified"]\n
added=context.REQUEST["added"]\n added=context.REQUEST["added"]\n
...@@ -80,18 +87,21 @@ tab_Removed=removed.split(\',\')\n ...@@ -80,18 +87,21 @@ tab_Removed=removed.split(\',\')\n
\n \n
if modified != \'none\':\n if modified != \'none\':\n
for f in tab_Modified:\n for f in tab_Modified:\n
f = svn_path+f \n
print "<b><font color=\'black\'>Index: <a href=\'BusinessTemplate_viewSvnShowFile?file="+f+"\'>"+f+"</a> <a href=\'"+context.getPortalObject()["portal_subversion"].editPath(context, f)+"\'><img src=\'imgs/edit.png\' border=\'0\'></a><br>"\n print "<b><font color=\'black\'>Index: <a href=\'BusinessTemplate_viewSvnShowFile?file="+f+"\'>"+f+"</a> <a href=\'"+context.getPortalObject()["portal_subversion"].editPath(context, f)+"\'><img src=\'imgs/edit.png\' border=\'0\'></a><br>"\n
print \'<hr></font></b>\'\n print \'<hr></font></b>\'\n
print context.getPortalObject()["portal_subversion"].diffHTML(f)\n print context.getPortalObject()["portal_subversion"].diffHTML(f)\n
\n \n
if added != \'none\':\n if added != \'none\':\n
for f in tab_Added:\n for f in tab_Added:\n
f = svn_path+f\n
print "<b><font color=\'black\'>Index: <a href=\'BusinessTemplate_viewSvnShowFile?file="+f+"\'>"+f+"</a> <a href=\'"+context.getPortalObject()["portal_subversion"].editPath(context, f)+"\'><img src=\'imgs/edit.png\' border=\'0\'></a><br>"\n print "<b><font color=\'black\'>Index: <a href=\'BusinessTemplate_viewSvnShowFile?file="+f+"\'>"+f+"</a> <a href=\'"+context.getPortalObject()["portal_subversion"].editPath(context, f)+"\'><img src=\'imgs/edit.png\' border=\'0\'></a><br>"\n
print \'<hr></font></b>\'\n print \'<hr></font></b>\'\n
print "<font color=\'green\'>File Added</font><br><br>"\n print "<font color=\'green\'>File Added</font><br><br>"\n
\n \n
if removed != \'none\':\n if removed != \'none\':\n
for f in tab_Removed:\n for f in tab_Removed:\n
f = svn_path+f\n
print "<b><font color=\'black\'>Index: <a href=\'BusinessTemplate_viewSvnShowFile?file="+f+"\'>"+f+"</a> <a href=\'"+context.getPortalObject()["portal_subversion"].editPath(context, f)+"\'><img src=\'imgs/edit.png\' border=\'0\'></a><br>"\n print "<b><font color=\'black\'>Index: <a href=\'BusinessTemplate_viewSvnShowFile?file="+f+"\'>"+f+"</a> <a href=\'"+context.getPortalObject()["portal_subversion"].editPath(context, f)+"\'><img src=\'imgs/edit.png\' border=\'0\'></a><br>"\n
print \'<hr></font></b>\'\n print \'<hr></font></b>\'\n
print "<font color=\'red\'>File Removed</font><br><br>"\n print "<font color=\'red\'>File Removed</font><br><br>"\n
...@@ -143,9 +153,10 @@ return printed\n ...@@ -143,9 +153,10 @@ return printed\n
<tuple> <tuple>
<string>_print_</string> <string>_print_</string>
<string>_print</string> <string>_print</string>
<string>_getitem_</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string> <string>context</string>
<string>svn_path</string>
<string>_getitem_</string>
<string>modified</string> <string>modified</string>
<string>added</string> <string>added</string>
<string>removed</string> <string>removed</string>
......
...@@ -67,6 +67,13 @@ ...@@ -67,6 +67,13 @@
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>from Products.ERP5Subversion.SubversionClient import SubversionSSLTrustError, SubversionLoginError\n <value> <string>from Products.ERP5Subversion.SubversionClient import SubversionSSLTrustError, SubversionLoginError\n
svn_path = context.getPortalObject().portal_preferences.getPreference(\'subversion_working_copy\')\n
if not svn_path :\n
raise "Error: Please set Subversion working path in preferences"\n
if svn_path[-1]!=\'/\':\n
svn_path+=\'/\'\n
\n
file = svn_path + file\n
\n \n
try:\n try:\n
log_list = context.getPortalObject()["portal_subversion"].log(file)\n log_list = context.getPortalObject()["portal_subversion"].log(file)\n
...@@ -123,8 +130,9 @@ return context.asContext(log_list=log_list, file=file, edit_path=context.getPort ...@@ -123,8 +130,9 @@ return context.asContext(log_list=log_list, file=file, edit_path=context.getPort
<string>SubversionSSLTrustError</string> <string>SubversionSSLTrustError</string>
<string>SubversionLoginError</string> <string>SubversionLoginError</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>_getitem_</string>
<string>context</string> <string>context</string>
<string>svn_path</string>
<string>_getitem_</string>
<string>log_list</string> <string>log_list</string>
<string>error</string> <string>error</string>
<string>error1</string> <string>error1</string>
......
...@@ -67,6 +67,12 @@ ...@@ -67,6 +67,12 @@
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>from Products.ERP5Subversion.SubversionClient import SubversionSSLTrustError, SubversionLoginError\n <value> <string>from Products.ERP5Subversion.SubversionClient import SubversionSSLTrustError, SubversionLoginError\n
svn_path = context.getPortalObject().portal_preferences.getPreference(\'subversion_working_copy\')\n
if not svn_path :\n
raise "Error: Please set Subversion working path in preferences"\n
if svn_path[-1]!=\'/\':\n
svn_path+=\'/\'\n
file = svn_path + file\n
\n \n
try:\n try:\n
infos_list = context.getPortalObject()["portal_subversion"].ls(file)\n infos_list = context.getPortalObject()["portal_subversion"].ls(file)\n
...@@ -123,8 +129,9 @@ return context.asContext(infos_list=infos_list, file=file, edit_path=context.get ...@@ -123,8 +129,9 @@ return context.asContext(infos_list=infos_list, file=file, edit_path=context.get
<string>SubversionSSLTrustError</string> <string>SubversionSSLTrustError</string>
<string>SubversionLoginError</string> <string>SubversionLoginError</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>_getitem_</string>
<string>context</string> <string>context</string>
<string>svn_path</string>
<string>_getitem_</string>
<string>infos_list</string> <string>infos_list</string>
<string>error</string> <string>error</string>
<string>error1</string> <string>error1</string>
......
...@@ -67,8 +67,15 @@ ...@@ -67,8 +67,15 @@
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>to_revert = files.split(\',\')\n <value> <string>to_revert = files.split(\',\')\n
svn_path = context.getPortalObject().portal_preferences.getPreference(\'subversion_working_copy\')\n
if not svn_path :\n
raise "Error: Please set Subversion working path in preferences"\n
if svn_path[-1]!=\'/\':\n
svn_path+=\'/\'\n
\n \n
if to_revert != \'none\' :\n if to_revert != \'none\' :\n
for relative_path in to_revert:\n
relative_path = svn_path + relative_path\n
context.getPortalObject()["portal_subversion"].revert(path=to_revert)\n context.getPortalObject()["portal_subversion"].revert(path=to_revert)\n
\n \n
context.REQUEST.set(\'portal_status_message\', \'Changes reverted successfully!\')\n context.REQUEST.set(\'portal_status_message\', \'Changes reverted successfully!\')\n
...@@ -116,8 +123,11 @@ return context.BusinessTemplate_viewSvnStatus()\n ...@@ -116,8 +123,11 @@ return context.BusinessTemplate_viewSvnStatus()\n
<string>files</string> <string>files</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>to_revert</string> <string>to_revert</string>
<string>_getitem_</string>
<string>context</string> <string>context</string>
<string>svn_path</string>
<string>_getitem_</string>
<string>_getiter_</string>
<string>relative_path</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
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