hackathon

8

Click here to load reader

Upload: erkin-uenlue

Post on 23-Jun-2015

125 views

Category:

Technology


4 download

DESCRIPTION

Hackathon at Pozitron

TRANSCRIPT

Page 1: Hackathon

HackathonDiff+

Page 2: Hackathon

Content

1. Diff+2. Mercurial API3. Mercurial Extensions4. Results

Page 3: Hackathon

Diff+

Analyzes java source filesIt is a mercurial extension Get two revisionsPrints diff of class and method numbers

Page 4: Hackathon

Mercurial APIhttp://mercurial.selenic.com/wiki/MercurialApi

You can easily get a repo and revisionfrom mercurial import ui, hg

repo = hg.repository(ui.ui(), repoName)

cctx = repo[revision]

Change context has files File Context has actual data

Page 5: Hackathon

Mercurial Extensionhttp://mercurial.selenic.com/wiki/WritingExtensionscmdtable = {

"analyze-java": (analyzeJava,

#[('r', 'revision', None, 'Other revision to be compared')],

[],

"hg analyze-java [options] REV REV2")

}

def analyzeJava(ui, repo, revision, revisionDiff, **opts):

Page 6: Hackathon

Mercurial Extension

How to use?

[extensions]

analyze-java= /home/POZITRON/erkin.unlu/setups/hg-analyze/analyzer_ext.py

Page 7: Hackathon

Resultshg analyze-java tip 2a80266f6adf

revision to get: tip

total class count in project: 828

total method count in project: 4834

revision to get: 2a80266f6adf

total class count in project: 784

total method count in project: 4600

class diff between revisions: 44

method diff between revisions: 234