Mercurial > hgrepos > DevTools > mercurial-extensions
diff extensions/revinfo.py @ 420:43fd36a465cc
Make revinfo and kwarchive compatible to Mercurial 5.8: ui.paths yields now a list of location objects
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Wed, 20 Oct 2021 09:33:37 +0200 |
| parents | 4885536aafc6 |
| children | bee0d9026720 |
line wrap: on
line diff
--- a/extensions/revinfo.py Sat Sep 11 17:52:51 2021 +0200 +++ b/extensions/revinfo.py Wed Oct 20 09:33:37 2021 +0200 @@ -30,7 +30,7 @@ registrar = None -testedwith = b"4.3.1 4.3.2 4.4.1 4.4.2 4.5.2 4.6.1 4.8.1 4.9 5.0.1 5.1.2 5.2.1 5.5 5.6" +testedwith = b"4.3.1 4.3.2 4.4.1 4.4.2 4.5.2 4.6.1 4.8.1 4.9 5.0.1 5.1.2 5.2.1 5.5 5.6 5.9.1" cmdtable = {} @@ -133,9 +133,17 @@ if canonicalpath == b'.': msg += b"path: %s\n" % repo.root else: - for name, path in sorted(ui.paths.items()): + # + # Since Mercurial 5.8 ui.paths[n] yields a list of + # locations + # + for name, paths in sorted(ui.paths.items()): + if not isinstance(paths, list): + paths = [paths] + # for now a quick check of assumptions + assert len(paths) == 1 if name == canonicalpath: - msg += b"path: %s\n" % util.hidepassword(path.loc) + msg += b"path: %s\n" % util.hidepassword(paths[0].loc) break else: msg += b"path: %s\n" % canonicalpath
