Commit 0680d221 authored by Julien Muchembled's avatar Julien Muchembled

ERP5VCS: implement 'Revert & Update' command for Git

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@44026 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 094b7bb2
......@@ -30,7 +30,9 @@
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
<value>
<none/>
</value>
</item>
<item>
<key> <string>icon</string> </key>
......@@ -38,7 +40,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>update_svn_bt</string> </value>
<value> <string>update_vcs_bt</string> </value>
</item>
<item>
<key> <string>permissions</string> </key>
......@@ -56,7 +58,7 @@
<key> <string>title</string> </key>
<value> <string encoding="cdata"><![CDATA[
Revert & Update Business Template from SVN
Revert & Update Business Template from VCS
]]></string> </value>
</item>
......@@ -75,7 +77,7 @@ Revert & Update Business Template from SVN
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/BusinessTemplate_doSvnUpdate</string> </value>
<value> <string>string:${object_url}/BusinessTemplate_doVcsUpdate</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -40,7 +40,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>update_svn_bt_norevert</string> </value>
<value> <string>update_vcs_bt_norevert</string> </value>
</item>
<item>
<key> <string>permissions</string> </key>
......@@ -56,7 +56,7 @@
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Update Business Template from SVN</string> </value>
<value> <string>Update Business Template from VCS</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
......@@ -73,7 +73,7 @@
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/BusinessTemplate_doSvnUpdate?keep:int=1</string> </value>
<value> <string>string:${object_url}/BusinessTemplate_doVcsUpdate?keep:int=1</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -73,7 +73,7 @@ return request.RESPONSE.redirect(\n
</item>
<item>
<key> <string>id</string> </key>
<value> <string>BusinessTemplate_doSvnUpdate</string> </value>
<value> <string>BusinessTemplate_doVcsUpdate</string> </value>
</item>
</dictionary>
</pickle>
......
644
\ No newline at end of file
645
\ No newline at end of file
......@@ -15,8 +15,8 @@ Business Template | manage_field_library
Business Template | rename_proxy_field
Business Template | svn_cleanup_locks
Business Template | svn_commit
Business Template | update_svn_bt
Business Template | update_svn_bt_norevert
Business Template | update_vcs_bt
Business Template | update_vcs_bt_norevert
Business Template | view_svn_repos_info
Glossary Module | create_term_for_translation
Glossary Module | export_po_file
......
......@@ -201,6 +201,27 @@ class Git(WorkingCopy):
path_list.append((content, child))
return (root.sub_dirs or root.sub_files) and root
def update(self, keep=False):
if self.getAheadCount():
raise NotImplementedError
if not keep:
self.clean()
self.git('pull', '--ff-only')
elif 1: # elif local_changes:
raise NotImplementedError
# addremove
# write-tree | commit-tree -> A
# symbolic-ref HEAD -> B
# try:
# checkout -f @{u}
# cherry-pick -n A || :
# update-ref B HEAD
# finally:
# symbolic-ref HEAD B
else:
self.git('pull', '--ff-only')
return self.aq_parent.download(self.working_copy)
def showOld(self, path):
return self.git('show', 'HEAD:' + self.prefix + path,
strip=False, cwd=self.toplevel)
......
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