Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/subrepo.py @ 24778:a48b65ab428d
subrepo: add include/exclude support for diffing git subrepos
Previously, git subrepos were ignored if any type of path selection
was done.
This can be solved by using subrepo status and filtering matching files.
author | Mathias De Mar? <mathias.demare@gmail.com> |
---|---|
date | Tue, 14 Apr 2015 20:09:56 +0200 |
parents | 747748766421 |
children | 39f519be5e65 |
comparison
equal
deleted
inserted
replaced
24777:077683371b7b | 24778:a48b65ab428d |
---|---|
1777 | 1777 |
1778 cmd.append(node1) | 1778 cmd.append(node1) |
1779 if node2: | 1779 if node2: |
1780 cmd.append(node2) | 1780 cmd.append(node2) |
1781 | 1781 |
1782 if match.anypats(): | |
1783 return #No support for include/exclude yet | |
1784 | |
1785 output = "" | 1782 output = "" |
1786 if match.always(): | 1783 if match.always(): |
1787 output += self._gitcommand(cmd) + '\n' | 1784 output += self._gitcommand(cmd) + '\n' |
1788 elif match.files(): | 1785 else: |
1789 for f in match.files(): | 1786 st = self.status(node2)[:3] |
1790 output += self._gitcommand(cmd + [f]) + '\n' | 1787 files = [f for sublist in st for f in sublist] |
1791 elif match(gitprefix): #Subrepo is matched | 1788 for f in files: |
1792 output += self._gitcommand(cmd) + '\n' | 1789 if match(f): |
1790 output += self._gitcommand(cmd + ['--', f]) + '\n' | |
1793 | 1791 |
1794 if output.strip(): | 1792 if output.strip(): |
1795 ui.write(output) | 1793 ui.write(output) |
1796 | 1794 |
1797 @annotatesubrepoerror | 1795 @annotatesubrepoerror |