[PATCH 2 of 3] publishing: use new helper method

Matt Mackall mpm at selenic.com
Thu Jun 18 23:30:22 CDT 2015


# HG changeset patch
# User Matt Mackall <mpm at selenic.com>
# Date 1434659662 18000
#      Thu Jun 18 15:34:22 2015 -0500
# Node ID c107cc0fb2fbb05d29c49a0659968fc256c8a846
# Parent  f72ee1cb416bac50ce88728650799fdd55b49322
publishing: use new helper method

diff -r f72ee1cb416b -r c107cc0fb2fb mercurial/changegroup.py
--- a/mercurial/changegroup.py	Thu Jun 18 15:33:24 2015 -0500
+++ b/mercurial/changegroup.py	Thu Jun 18 15:34:22 2015 -0500
@@ -820,7 +820,7 @@
             repo.hook('pretxnchangegroup', throw=True, pending=p, **hookargs)
 
         added = [cl.node(r) for r in xrange(clstart, clend)]
-        publishing = repo.ui.configbool('phases', 'publish', True)
+        publishing = repo.publishing()
         if srctype in ('push', 'serve'):
             # Old servers can not push the boundary themselves.
             # New servers won't push the boundary if changeset already
diff -r f72ee1cb416b -r c107cc0fb2fb mercurial/hg.py
--- a/mercurial/hg.py	Thu Jun 18 15:33:24 2015 -0500
+++ b/mercurial/hg.py	Thu Jun 18 15:34:22 2015 -0500
@@ -253,7 +253,7 @@
                 closetopic[0] = topic
             else:
                 ui.progress(topic, pos + num)
-        srcpublishing = srcrepo.ui.configbool('phases', 'publish', True)
+        srcpublishing = srcrepo.publishing()
         srcvfs = scmutil.vfs(srcrepo.sharedpath)
         dstvfs = scmutil.vfs(destpath)
         for f in srcrepo.store.copylist():
diff -r f72ee1cb416b -r c107cc0fb2fb mercurial/localrepo.py
--- a/mercurial/localrepo.py	Thu Jun 18 15:33:24 2015 -0500
+++ b/mercurial/localrepo.py	Thu Jun 18 15:34:22 2015 -0500
@@ -804,7 +804,7 @@
         # so statichttprepo's override of local() works
         if not self.local():
             return False
-        if not self.ui.configbool('phases', 'publish', True):
+        if not self.publishing():
             return True
         # if publishing we can't copy if there is filtered content
         return not self.filtered('visible').changelog.filteredrevs
diff -r f72ee1cb416b -r c107cc0fb2fb mercurial/phases.py
--- a/mercurial/phases.py	Thu Jun 18 15:33:24 2015 -0500
+++ b/mercurial/phases.py	Thu Jun 18 15:34:22 2015 -0500
@@ -360,7 +360,7 @@
     for root in repo._phasecache.phaseroots[draft]:
         keys[hex(root)] = value
 
-    if repo.ui.configbool('phases', 'publish', True):
+    if repo.publishing():
         # Add an extra data to let remote know we are a publishing
         # repo. Publishing repo can't just pretend they are old repo.
         # When pushing to a publishing repo, the client still need to


More information about the Mercurial-devel mailing list