D4554: bundlerepo: factor out code for instantiating a bundle repository

2018-09-13 Thread indygreg (Gregory Szorc)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGa8d2faeca49e: bundlerepo: factor out code for instantiating 
a bundle repository (authored by indygreg, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D4554?vs=10986=10997

REVISION DETAIL
  https://phab.mercurial-scm.org/D4554

AFFECTED FILES
  mercurial/bundlerepo.py

CHANGE DETAILS

diff --git a/mercurial/bundlerepo.py b/mercurial/bundlerepo.py
--- a/mercurial/bundlerepo.py
+++ b/mercurial/bundlerepo.py
@@ -479,7 +479,12 @@
 repopath, bundlename = s
 else:
 repopath, bundlename = parentpath, path
-return bundlerepository(ui, repopath, bundlename)
+
+return makebundlerepository(ui, repopath, bundlename)
+
+def makebundlerepository(ui, repopath, bundlepath):
+"""Make a bundle repository object based on repo and bundle paths."""
+return bundlerepository(ui, repopath, bundlepath)
 
 class bundletransactionmanager(object):
 def transaction(self):
@@ -588,8 +593,10 @@
 bundle = None
 if not localrepo:
 # use the created uncompressed bundlerepo
-localrepo = bundlerepo = bundlerepository(repo.baseui, repo.root,
-  fname)
+localrepo = bundlerepo = makebundlerepository(repo. baseui,
+  repo.root,
+  fname)
+
 # this repo contains local and peer now, so filter out local again
 common = repo.heads()
 if localrepo:



To: indygreg, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D4554: bundlerepo: factor out code for instantiating a bundle repository

2018-09-12 Thread indygreg (Gregory Szorc)
indygreg created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  This code will soon become a bit more complicated. So extract to its
  own function.
  
  And change both instantiators of bundlerepository to use it.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D4554

AFFECTED FILES
  mercurial/bundlerepo.py

CHANGE DETAILS

diff --git a/mercurial/bundlerepo.py b/mercurial/bundlerepo.py
--- a/mercurial/bundlerepo.py
+++ b/mercurial/bundlerepo.py
@@ -479,7 +479,12 @@
 repopath, bundlename = s
 else:
 repopath, bundlename = parentpath, path
-return bundlerepository(ui, repopath, bundlename)
+
+return makebundlerepository(ui, repopath, bundlename)
+
+def makebundlerepository(ui, repopath, bundlepath):
+"""Make a bundle repository object based on repo and bundle paths."""
+return bundlerepository(ui, repopath, bundlepath)
 
 class bundletransactionmanager(object):
 def transaction(self):
@@ -588,8 +593,10 @@
 bundle = None
 if not localrepo:
 # use the created uncompressed bundlerepo
-localrepo = bundlerepo = bundlerepository(repo.baseui, repo.root,
-  fname)
+localrepo = bundlerepo = makebundlerepository(repo. baseui,
+  repo.root,
+  fname)
+
 # this repo contains local and peer now, so filter out local again
 common = repo.heads()
 if localrepo:



To: indygreg, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel