mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-10 14:07:43 +00:00
BlenderBIM fix Git merge log history (#3096)
The GitPython commit() method isn't suitable for completing a merge as it only sets one parent, losing all history from the merged branch.
This commit is contained in:
@@ -199,9 +199,9 @@ class COMMIT_UL_List(bpy.types.UIList):
|
|||||||
refs += "{" + tag.name + "} "
|
refs += "{" + tag.name + "} "
|
||||||
|
|
||||||
if commit == current_revision:
|
if commit == current_revision:
|
||||||
layout.label(text="[HEAD] " + refs + commit.message, icon="DECORATE_KEYFRAME")
|
layout.label(text="[HEAD] " + refs + commit.message.split("\n")[0], icon="DECORATE_KEYFRAME")
|
||||||
else:
|
else:
|
||||||
layout.label(text=refs + commit.message, icon="DECORATE_ANIMATE")
|
layout.label(text=refs + commit.message.split("\n")[0], icon="DECORATE_ANIMATE")
|
||||||
layout.label(text=time.strftime("%c", time.localtime(commit.committed_date)))
|
layout.label(text=time.strftime("%c", time.localtime(commit.committed_date)))
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -420,15 +420,12 @@ class IfcGit:
|
|||||||
operator.report({"ERROR"}, "Unknown IFC Merge failure")
|
operator.report({"ERROR"}, "Unknown IFC Merge failure")
|
||||||
return False
|
return False
|
||||||
|
|
||||||
repo.index.add(path_ifc)
|
|
||||||
|
|
||||||
message_summary = repo.git.shortlog(repo.active_branch.name + ".." + props.display_branch)
|
|
||||||
props.commit_message = (
|
|
||||||
"Merge branch '" + props.display_branch + "' into " + repo.active_branch.name + "\n\n" + message_summary
|
|
||||||
)
|
|
||||||
props.display_branch = repo.active_branch.name
|
props.display_branch = repo.active_branch.name
|
||||||
|
|
||||||
cls.git_commit(path_ifc)
|
if os.name == "nt":
|
||||||
|
cls.dos2unix(path_ifc)
|
||||||
|
repo.index.add(path_ifc)
|
||||||
|
repo.git.commit("--no-edit")
|
||||||
cls.load_project(path_ifc)
|
cls.load_project(path_ifc)
|
||||||
cls.refresh_revision_list(path_ifc)
|
cls.refresh_revision_list(path_ifc)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user