# HG changeset patch # User Augie Fackler # Date 1449084737 18000 # Node ID de3335b4c8efb4ed279b00ba7526462b546fb64c # Parent 1ec23f3e62f3552ec091f7450a051e4737304c93 changegroup: note during bundle apply if the repo was empty An upcoming change for exchanging treemanifest data will need to update the repository capabilities, which we should only do if the repository was empty before we started applying this changegroup. In the future we will probably need a strategy for upgrading to treemanifest in requires during a pull (I'm assuming at some point we'll make it possible to have a flag day to enable treemanifests on an existing history.) diff -r 1ec23f3e62f3 -r de3335b4c8ef mercurial/changegroup.py --- a/mercurial/changegroup.py Wed Dec 02 07:41:35 2015 +0000 +++ b/mercurial/changegroup.py Wed Dec 02 14:32:17 2015 -0500 @@ -312,6 +312,7 @@ - number of heads stays the same: 1 """ repo = repo.unfiltered() + wasempty = (len(repo.changelog) == 0) def csmap(x): repo.ui.debug("add changeset %s\n" % short(x)) return len(cl) @@ -386,7 +387,7 @@ self.callback = None pr = prog(_('files'), efiles) newrevs, newfiles = _addchangegroupfiles( - repo, self, revmap, trp, pr, needfiles) + repo, self, revmap, trp, pr, needfiles, wasempty) revisions += newrevs files += newfiles @@ -903,7 +904,7 @@ # to avoid a race we use changegroupsubset() (issue1320) return changegroupsubset(repo, basenodes, repo.heads(), source) -def _addchangegroupfiles(repo, source, revmap, trp, pr, needfiles): +def _addchangegroupfiles(repo, source, revmap, trp, pr, needfiles, wasempty): revisions = 0 files = 0 while True: