comparison mercurial/bundle2.py @ 33252:53b3a1968aa6

obsolete: reports the number of local changeset obsoleted when unbundling This is a first basic visible usage of the changes tracking in the transaction. We adds a new function computing the pre-existing changesets obsoleted by a transaction and a transaction call back displaying this information. Example output: added 1 changesets with 1 changes to 1 files (+1 heads) 3 new obsolescence markers obsoleted 1 changesets The goal is to evolve the transaction summary into something bigger, gathering existing output there and adding new useful one. This patch is a good first step on this road. The new output is basic but give a user to the content of tr.changes['obsmarkers'] and give an idea of the new options we haves. I expect to revisit the message soon. The caller recording the transaction summary should also be moved into a more generic location but further refactoring is needed before it can happen.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 28 Jun 2017 03:54:19 +0200
parents 593ad8df9dd2
children 39d4e5a66f5a
comparison
equal deleted inserted replaced
33251:a5cb2e4460de 33252:53b3a1968aa6
159 error, 159 error,
160 obsolete, 160 obsolete,
161 phases, 161 phases,
162 pushkey, 162 pushkey,
163 pycompat, 163 pycompat,
164 scmutil,
164 tags, 165 tags,
165 url, 166 url,
166 util, 167 util,
167 ) 168 )
168 169
1808 new = op.repo.obsstore.mergemarkers(tr, markerdata) 1809 new = op.repo.obsstore.mergemarkers(tr, markerdata)
1809 op.repo.invalidatevolatilesets() 1810 op.repo.invalidatevolatilesets()
1810 if new: 1811 if new:
1811 op.repo.ui.status(_('%i new obsolescence markers\n') % new) 1812 op.repo.ui.status(_('%i new obsolescence markers\n') % new)
1812 op.records.add('obsmarkers', {'new': new}) 1813 op.records.add('obsmarkers', {'new': new})
1814 scmutil.registersummarycallback(op.repo, tr)
1813 if op.reply is not None: 1815 if op.reply is not None:
1814 rpart = op.reply.newpart('reply:obsmarkers') 1816 rpart = op.reply.newpart('reply:obsmarkers')
1815 rpart.addparam('in-reply-to', str(inpart.id), mandatory=False) 1817 rpart.addparam('in-reply-to', str(inpart.id), mandatory=False)
1816 rpart.addparam('new', '%i' % new, mandatory=False) 1818 rpart.addparam('new', '%i' % new, mandatory=False)
1817 1819