# HG changeset patch
# User Angel Ezquerra <[email protected]>
# Date 1456709709 -3600
# Mon Feb 29 02:35:09 2016 +0100
# Branch stable
# Node ID e16bf58e69344c32cfec314efe6d27cd77596e59
# Parent 1c060576ac430bc9503cff6f8cbc1b4e0329b57f
hg/repository: add subrepos method
This new method returns a (sorted) list of subrepository paths that are refered
to by a given set of revisions. If no revisions are specified the current
repository heads are used by default.
diff --git a/kallithea/lib/vcs/backends/hg/repository.py
b/kallithea/lib/vcs/backends/hg/repository.py
--- a/kallithea/lib/vcs/backends/hg/repository.py
+++ b/kallithea/lib/vcs/backends/hg/repository.py
@@ -227,6 +227,19 @@
self._repo._bookmarks.items()]
return OrderedDict(sorted(_bookmarks, key=sortkey, reverse=True))
+ def subrepos(self, revs=None):
+ """
+ Gets subrepo paths referenced by any of the selected revisions
+
+ Subrepo paths are returned relative to the root of the repository
+ """
+ if revs is None:
+ revs = self._repo.heads()
+ subpaths = set()
+ for r in revs:
+ subpaths = subpaths.union(set(self._repo[r].substate.keys()))
+ return sorted(list(subpaths))
+
def _get_all_revisions(self):
return [self._repo[x].hex() for x in
self._repo.filtered('visible').changelog.revs()]
# HG changeset patch
# User Angel Ezquerra <[email protected]>
# Date 1456709709 -3600
# Mon Feb 29 02:35:09 2016 +0100
# Branch stable
# Node ID e16bf58e69344c32cfec314efe6d27cd77596e59
# Parent 1c060576ac430bc9503cff6f8cbc1b4e0329b57f
hg/repository: add subrepos method
This new method returns a (sorted) list of subrepository paths that are refered
to by a given set of revisions. If no revisions are specified the current
repository heads are used by default.
diff --git a/kallithea/lib/vcs/backends/hg/repository.py b/kallithea/lib/vcs/backends/hg/repository.py
--- a/kallithea/lib/vcs/backends/hg/repository.py
+++ b/kallithea/lib/vcs/backends/hg/repository.py
@@ -227,6 +227,19 @@
self._repo._bookmarks.items()]
return OrderedDict(sorted(_bookmarks, key=sortkey, reverse=True))
+ def subrepos(self, revs=None):
+ """
+ Gets subrepo paths referenced by any of the selected revisions
+
+ Subrepo paths are returned relative to the root of the repository
+ """
+ if revs is None:
+ revs = self._repo.heads()
+ subpaths = set()
+ for r in revs:
+ subpaths = subpaths.union(set(self._repo[r].substate.keys()))
+ return sorted(list(subpaths))
+
def _get_all_revisions(self):
return [self._repo[x].hex() for x in self._repo.filtered('visible').changelog.revs()]
_______________________________________________
kallithea-general mailing list
[email protected]
http://lists.sfconservancy.org/mailman/listinfo/kallithea-general