##// END OF EJS Templates
push: factorise phase movement in a simple closure...
Pierre-Yves David -
r19096:0e4af72c stable
parent child Browse files
Show More
@@ -1762,6 +1762,9 b' class localrepository(object):'
1762 if not remote.canpush():
1762 if not remote.canpush():
1763 raise util.Abort(_("destination does not support push"))
1763 raise util.Abort(_("destination does not support push"))
1764 unfi = self.unfiltered()
1764 unfi = self.unfiltered()
1765 def localphasemove(nodes, phase=phases.public):
1766 """move <nodes> to <phase> in the local source repo"""
1767 phases.advanceboundary(self, phase, nodes)
1765 # get local lock as we might write phase data
1768 # get local lock as we might write phase data
1766 locallock = self.lock()
1769 locallock = self.lock()
1767 try:
1770 try:
@@ -1883,17 +1886,17 b' class localrepository(object):'
1883 # on the remote.
1886 # on the remote.
1884 remotephases = {'publishing': 'True'}
1887 remotephases = {'publishing': 'True'}
1885 if not remotephases: # old server or public only repo
1888 if not remotephases: # old server or public only repo
1886 phases.advanceboundary(self, phases.public, cheads)
1889 localphasemove(cheads)
1887 # don't push any phase data as there is nothing to push
1890 # don't push any phase data as there is nothing to push
1888 else:
1891 else:
1889 ana = phases.analyzeremotephases(self, cheads, remotephases)
1892 ana = phases.analyzeremotephases(self, cheads, remotephases)
1890 pheads, droots = ana
1893 pheads, droots = ana
1891 ### Apply remote phase on local
1894 ### Apply remote phase on local
1892 if remotephases.get('publishing', False):
1895 if remotephases.get('publishing', False):
1893 phases.advanceboundary(self, phases.public, cheads)
1896 localphasemove(cheads)
1894 else: # publish = False
1897 else: # publish = False
1895 phases.advanceboundary(self, phases.public, pheads)
1898 localphasemove(pheads)
1896 phases.advanceboundary(self, phases.draft, cheads)
1899 localphasemove(cheads, phases.draft)
1897 ### Apply local phase on remote
1900 ### Apply local phase on remote
1898
1901
1899 # Get the list of all revs draft on remote by public here.
1902 # Get the list of all revs draft on remote by public here.
General Comments 0
You need to be logged in to leave comments. Login now