Perform a deep copy of version objects
This commit is contained in:
parent
bc6a637c59
commit
e8ea9a2932
2 changed files with 22 additions and 2 deletions
|
|
@ -108,6 +108,15 @@ class GitInfo extends GISJsonSerialised {
|
||||||
this.remoteinfo = remoteinfo
|
this.remoteinfo = remoteinfo
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GitInfo(GitInfo another) {
|
||||||
|
super(another.script)
|
||||||
|
this.sourcepath = another.sourcepath
|
||||||
|
this.sourcerevision = another.sourcerevision
|
||||||
|
this.gitrevision = another.gitrevision
|
||||||
|
this.remoteurl = another.remoteurl
|
||||||
|
this.remoteinfo = another.remoteinfo
|
||||||
|
}
|
||||||
|
|
||||||
void set(String sourcepath, String sourcerevision, String gitrevision, String remoteurl, String remoteinfo) {
|
void set(String sourcepath, String sourcerevision, String gitrevision, String remoteurl, String remoteinfo) {
|
||||||
this.sourcepath = sourcepath
|
this.sourcepath = sourcepath
|
||||||
this.sourcerevision = sourcerevision
|
this.sourcerevision = sourcerevision
|
||||||
|
|
@ -267,6 +276,13 @@ class BuildStampInfo extends GISJsonSerialised {
|
||||||
this.buildstamp = buildstamp
|
this.buildstamp = buildstamp
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BuildStampInfo(BuildStampInfo another) {
|
||||||
|
super(another.script)
|
||||||
|
this.buildstampprefix = another.buildstampprefix
|
||||||
|
this.revision = another.revision
|
||||||
|
this.buildstamp = another.buildstamp
|
||||||
|
}
|
||||||
|
|
||||||
void set(String buildstampprefix, int revision, String buildstamp) {
|
void set(String buildstampprefix, int revision, String buildstamp) {
|
||||||
this.buildstampprefix = buildstampprefix
|
this.buildstampprefix = buildstampprefix
|
||||||
this.revision = revision
|
this.revision = revision
|
||||||
|
|
|
||||||
|
|
@ -160,8 +160,12 @@ String generate(meta, String sourcerevision, String sourcepath, String basebuild
|
||||||
}
|
}
|
||||||
|
|
||||||
String copyfrom(meta, othermeta) {
|
String copyfrom(meta, othermeta) {
|
||||||
meta.gitinfo = othermeta.gitinfo
|
// Deep copy
|
||||||
meta.buildstampinfo = othermeta.buildstampinfo
|
def newgitinfo = othermeta.gitinfo.getClass().newInstance(othermeta.gitinfo)
|
||||||
|
def newbuildstampinfo = othermeta.buildstampinfo.getClass().newInstance(othermeta.buildstampinfo)
|
||||||
|
|
||||||
|
meta.gitinfo = newgitinfo
|
||||||
|
meta.buildstampinfo = newbuildstampinfo
|
||||||
|
|
||||||
return meta.buildstampinfo.buildstamp
|
return meta.buildstampinfo.buildstamp
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue