How to calculate the delta size while diffing the files in TeamFoundationServer ?
currently, need calculate delta size while diffing files in teamfoundationserver, don't know wheter there are existed tfs api in msdn. far did not find it. familiar it? or deliver suggestions?
thanks in advance !!
thanks materials !!
here solution below:
private int calsinglefiledelta(string strbase, string strshelve) { int nfiledelta = 0; arraylist alorgstart = new arraylist(); arraylist aldesstart = new arraylist(); arraylist alunchangedlen = new arraylist(); diffsegment diffseg = difference.difffiles(strbase, encoding.ascii.codepage, strshelve, encoding.ascii.codepage, new diffoptions()); if (diffseg != null) { alorgstart.add(diffseg.originalstart); aldesstart.add(diffseg.modifiedstart); alunchangedlen.add(diffseg.modifiedlength); while (diffseg.next != null) { diffseg = diffseg.next; alorgstart.add(diffseg.originalstart); aldesstart.add(diffseg.modifiedstart); alunchangedlen.add(diffseg.modifiedlength); } (int = 0; < (alorgstart.count-1); i++) { int norgdel = int32.parse(alorgstart[i + 1].tostring()) - (int32.parse(alorgstart[i].tostring()) + int32.parse(alunchangedlen[i].tostring())); int ndesdel = int32.parse(aldesstart[i + 1].tostring()) - (int32.parse(aldesstart[i].tostring()) + int32.parse(alunchangedlen[i].tostring())); int nsegdel = system.math.max(norgdel, ndesdel); nfiledelta += nsegdel; } } return nfiledelta; }
think there exists problem on naming of diffsegment property "modifiedlength", means unchanged length of file.
Archived Forums V > Team Foundation Server - Source and Version Control
Comments
Post a Comment