%PDF- %PDF-
Direktori : /proc/985914/root/data/old/home/stash/stash/atlassian-stash/static/model/ |
Current File : //proc/985914/root/data/old/home/stash/stash/atlassian-stash/static/model/file-change-min.js |
define("model/file-change",["backbone-brace","util/deprecation","model/commit-range","model/conflict","model/file-change-types","model/path","model/repository"],function(C,F,B,H,E,D,A){var G=C.Model.extend({namedAttributes:{repository:A,commitRange:B,srcPath:D,path:D,line:null,search:null,type:null,nodeType:null,conflict:H,diff:null,srcExecutable:null,executable:null},initialize:function(){if(this.getPath()){this.setPath(new D(this.getPath()))}if(this.getSrcPath()){this.setSrcPath(new D(this.getSrcPath()))}this.setType(G._mapChangeType(this.getType(),this.getSrcPath(),this.getPath()))}},{fromDiff:function(J,I,M){var L;var K=J.hunks[0];if(K){if(K.sourceLine===0){L=E.ADD}else{if(K.destinationLine===0){L=E.DELETE}else{L=E.MODIFY}}}return new G({repository:M,commitRange:I,srcPath:J.source,path:J.destination,diff:J,type:L})},_mapChangeType:function(I,K,J){return(I===E.MOVE&&K&&K.isSameDirectory(J))?E.RENAME:E.changeTypeFromId(I)}});(function(I){G.prototype.toJSON=function(){var J=I.apply(this,arguments);if(this.getPath()){J.path=F.jsonAsBrace(this.getPath(),"3.1","4.0")}if(this.getSrcPath()){J.srcPath=F.jsonAsBrace(this.getSrcPath(),"3.1","4.0")}return J}})(G.prototype.toJSON);return G});