##// END OF EJS Templates
subrepo: use `changing_files` context in subrepository code...
marmoute -
r50941:2264e775 default
parent child Browse files
Show More
@@ -569,6 +569,11 b' class hgsubrepo(abstractsubrepo):'
569 569
570 570 @annotatesubrepoerror
571 571 def add(self, ui, match, prefix, uipathfn, explicitonly, **opts):
572 # XXX Ideally, we could let the caller take the `changing_files`
573 # context. However this is not an abstraction that make sense for
574 # other repository types, and leaking that details purely related to
575 # dirstate seems unfortunate. So for now the context will be used here.
576 with self._repo.wlock(), self._repo.dirstate.changing_files(self._repo):
572 577 return cmdutil.add(
573 578 ui,
574 579 self._repo,
@@ -586,7 +591,18 b' class hgsubrepo(abstractsubrepo):'
586 591 # be used to process sibling subrepos however.
587 592 opts = copy.copy(opts)
588 593 opts[b'subrepos'] = True
589 return scmutil.addremove(self._repo, m, prefix, uipathfn, opts)
594 # XXX Ideally, we could let the caller take the `changing_files`
595 # context. However this is not an abstraction that make sense for
596 # other repository types, and leaking that details purely related to
597 # dirstate seems unfortunate. So for now the context will be used here.
598 with self._repo.wlock(), self._repo.dirstate.changing_files(self._repo):
599 return scmutil.addremove(
600 self._repo,
601 m,
602 prefix,
603 uipathfn,
604 opts,
605 )
590 606
591 607 @annotatesubrepoerror
592 608 def cat(self, match, fm, fntemplate, prefix, **opts):
@@ -952,6 +968,11 b' class hgsubrepo(abstractsubrepo):'
952 968
953 969 @annotatesubrepoerror
954 970 def forget(self, match, prefix, uipathfn, dryrun, interactive):
971 # XXX Ideally, we could let the caller take the `changing_files`
972 # context. However this is not an abstraction that make sense for
973 # other repository types, and leaking that details purely related to
974 # dirstate seems unfortunate. So for now the context will be used here.
975 with self._repo.wlock(), self._repo.dirstate.changing_files(self._repo):
955 976 return cmdutil.forget(
956 977 self.ui,
957 978 self._repo,
@@ -975,6 +996,11 b' class hgsubrepo(abstractsubrepo):'
975 996 dryrun,
976 997 warnings,
977 998 ):
999 # XXX Ideally, we could let the caller take the `changing_files`
1000 # context. However this is not an abstraction that make sense for
1001 # other repository types, and leaking that details purely related to
1002 # dirstate seems unfortunate. So for now the context will be used here.
1003 with self._repo.wlock(), self._repo.dirstate.changing_files(self._repo):
978 1004 return cmdutil.remove(
979 1005 self.ui,
980 1006 self._repo,
@@ -1015,6 +1041,11 b' class hgsubrepo(abstractsubrepo):'
1015 1041 pats = [b'set:modified()']
1016 1042 else:
1017 1043 pats = []
1044 # XXX Ideally, we could let the caller take the `changing_files`
1045 # context. However this is not an abstraction that make sense for
1046 # other repository types, and leaking that details purely related to
1047 # dirstate seems unfortunate. So for now the context will be used here.
1048 with self._repo.wlock(), self._repo.dirstate.changing_files(self._repo):
1018 1049 cmdutil.revert(self.ui, self._repo, ctx, *pats, **opts)
1019 1050
1020 1051 def shortid(self, revid):
General Comments 0
You need to be logged in to leave comments. Login now