comparison mercurial/subrepo.py @ 23938:de519517f597 stable

subrepo: correctly add newline for git subrepo diffs Previously, git subrepo diffs did not have a newline at the end. This caused multiple subrepo diffs to be joined on the same line. Additionally, the command prompt after the diff still contained a part of the diff.
author Mathias De Mar? <mathias.demare@gmail.com>
date Wed, 21 Jan 2015 21:47:27 +0100
parents 9994f45ba714
children 8f02682ff3b0
comparison
equal deleted inserted replaced
23937:fd5b9417d315 23938:de519517f597
1646 cmd.append(node2) 1646 cmd.append(node2)
1647 1647
1648 if match.anypats(): 1648 if match.anypats():
1649 return #No support for include/exclude yet 1649 return #No support for include/exclude yet
1650 1650
1651 output = ""
1651 if match.always(): 1652 if match.always():
1652 ui.write(self._gitcommand(cmd)) 1653 output += self._gitcommand(cmd) + '\n'
1653 elif match.files(): 1654 elif match.files():
1654 for f in match.files(): 1655 for f in match.files():
1655 ui.write(self._gitcommand(cmd + [f])) 1656 output += self._gitcommand(cmd + [f]) + '\n'
1656 elif match(gitprefix): #Subrepo is matched 1657 elif match(gitprefix): #Subrepo is matched
1657 ui.write(self._gitcommand(cmd)) 1658 output += self._gitcommand(cmd) + '\n'
1659
1660 if output.strip():
1661 ui.write(output)
1658 1662
1659 @annotatesubrepoerror 1663 @annotatesubrepoerror
1660 def revert(self, substate, *pats, **opts): 1664 def revert(self, substate, *pats, **opts):
1661 self.ui.status(_('reverting subrepo %s\n') % substate[0]) 1665 self.ui.status(_('reverting subrepo %s\n') % substate[0])
1662 if not opts.get('no_backup'): 1666 if not opts.get('no_backup'):