Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/subrepo.py @ 50101:bbe3a65bbd96
subrepo: let black expand some call on multiple lines early
newer version of black are righfully doing this, so I apply it before more
semantic change to reduce noise in the next changeset.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Sat, 04 Feb 2023 12:14:19 +0100 |
parents | b9fcf54030d7 |
children | 2264e775512b |
comparison
equal
deleted
inserted
replaced
50100:e8c170a6571d | 50101:bbe3a65bbd96 |
---|---|
568 self._repo.vfs.write(b'hgrc', util.tonativeeol(b''.join(lines))) | 568 self._repo.vfs.write(b'hgrc', util.tonativeeol(b''.join(lines))) |
569 | 569 |
570 @annotatesubrepoerror | 570 @annotatesubrepoerror |
571 def add(self, ui, match, prefix, uipathfn, explicitonly, **opts): | 571 def add(self, ui, match, prefix, uipathfn, explicitonly, **opts): |
572 return cmdutil.add( | 572 return cmdutil.add( |
573 ui, self._repo, match, prefix, uipathfn, explicitonly, **opts | 573 ui, |
574 self._repo, | |
575 match, | |
576 prefix, | |
577 uipathfn, | |
578 explicitonly, | |
579 **opts, | |
574 ) | 580 ) |
575 | 581 |
576 @annotatesubrepoerror | 582 @annotatesubrepoerror |
577 def addremove(self, m, prefix, uipathfn, opts): | 583 def addremove(self, m, prefix, uipathfn, opts): |
578 # In the same way as sub directories are processed, once in a subrepo, | 584 # In the same way as sub directories are processed, once in a subrepo, |
619 self._repo[node1], | 625 self._repo[node1], |
620 self._repo[node2], | 626 self._repo[node2], |
621 match, | 627 match, |
622 prefix=prefix, | 628 prefix=prefix, |
623 listsubrepos=True, | 629 listsubrepos=True, |
624 **opts | 630 **opts, |
625 ) | 631 ) |
626 except error.RepoLookupError as inst: | 632 except error.RepoLookupError as inst: |
627 self.ui.warn( | 633 self.ui.warn( |
628 _(b'warning: error "%s" in subrepository "%s"\n') | 634 _(b'warning: error "%s" in subrepository "%s"\n') |
629 % (inst, subrelpath(self)) | 635 % (inst, subrelpath(self)) |
1121 bufsize=-1, | 1127 bufsize=-1, |
1122 close_fds=procutil.closefds, | 1128 close_fds=procutil.closefds, |
1123 stdout=subprocess.PIPE, | 1129 stdout=subprocess.PIPE, |
1124 stderr=subprocess.PIPE, | 1130 stderr=subprocess.PIPE, |
1125 env=procutil.tonativeenv(env), | 1131 env=procutil.tonativeenv(env), |
1126 **extrakw | 1132 **extrakw, |
1127 ) | 1133 ) |
1128 stdout, stderr = map(util.fromnativeeol, p.communicate()) | 1134 stdout, stderr = map(util.fromnativeeol, p.communicate()) |
1129 stderr = stderr.strip() | 1135 stderr = stderr.strip() |
1130 if not failok: | 1136 if not failok: |
1131 if p.returncode: | 1137 if p.returncode: |
1486 cwd=pycompat.rapply(procutil.tonativestr, cwd), | 1492 cwd=pycompat.rapply(procutil.tonativestr, cwd), |
1487 env=procutil.tonativeenv(env), | 1493 env=procutil.tonativeenv(env), |
1488 close_fds=procutil.closefds, | 1494 close_fds=procutil.closefds, |
1489 stdout=subprocess.PIPE, | 1495 stdout=subprocess.PIPE, |
1490 stderr=errpipe, | 1496 stderr=errpipe, |
1491 **extrakw | 1497 **extrakw, |
1492 ) | 1498 ) |
1493 if stream: | 1499 if stream: |
1494 return p.stdout, None | 1500 return p.stdout, None |
1495 | 1501 |
1496 retdata = p.stdout.read().strip() | 1502 retdata = p.stdout.read().strip() |