Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 2.0, 2.0.1, and 2.0.2

stable thgrepo: introduce a recursive merge status generator

Changeset f170774f1898

Parent 6bc689498c4c

by Steve Borho

Changes to one file · Browse files at f170774f1898 Showing diff from parent 6bc689498c4c Diff from another changeset...

 
16
17
18
 
19
20
21
 
574
575
576
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
17
18
19
20
21
22
 
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
@@ -16,6 +16,7 @@
 from PyQt4.QtCore import *    from mercurial import hg, util, error, bundlerepo, extensions, filemerge, node +from mercurial import merge, subrepo  from mercurial import ui as uimod  from mercurial.util import propertycache   @@ -574,3 +575,17 @@
  ctx = patchctx(patchpath, repo, rev=rev)   _pctxcache[patchpath] = ctx   return ctx + +def recursiveMergeStatus(repo): + ms = merge.mergestate(repo) + for wfile in ms: + yield repo.root, wfile, ms[wfile] + try: + wctx = repo[None] + for s in wctx.substate: + sub = wctx.sub(s) + if isinstance(sub, subrepo.hgsubrepo): + for root, file, status in recursiveMergeStatus(sub._repo): + yield root, file, status + except (EnvironmentError, error.Abort, error.RepoError): + pass