mercurial/context.py
changeset 23237 98f41a2f8fba
parent 23236 7ea2ef4479f2
child 23238 39eb9f78f968
equal deleted inserted replaced
23236:7ea2ef4479f2 23237:98f41a2f8fba
    83         for fn in mf.keys():
    83         for fn in mf.keys():
    84             if not match(fn):
    84             if not match(fn):
    85                 del mf[fn]
    85                 del mf[fn]
    86         return mf
    86         return mf
    87 
    87 
    88     def _matchstatus(self, other, s, match, listignored, listclean,
    88     def _matchstatus(self, other, match):
    89                      listunknown):
       
    90         """return match.always if match is none
    89         """return match.always if match is none
    91 
    90 
    92         This internal method provides a way for child objects to override the
    91         This internal method provides a way for child objects to override the
    93         match operator.
    92         match operator.
    94         """
    93         """
   309         if (not isinstance(ctx1, changectx)
   308         if (not isinstance(ctx1, changectx)
   310             and isinstance(ctx2, changectx)):
   309             and isinstance(ctx2, changectx)):
   311             reversed = True
   310             reversed = True
   312             ctx1, ctx2 = ctx2, ctx1
   311             ctx1, ctx2 = ctx2, ctx1
   313 
   312 
       
   313         match = ctx2._matchstatus(ctx1, match)
   314         r = [[], [], [], [], [], [], []]
   314         r = [[], [], [], [], [], [], []]
   315         match = ctx2._matchstatus(ctx1, r, match, listignored, listclean,
       
   316                                   listunknown)
       
   317         r = ctx2._prestatus(ctx1, r, match, listignored, listclean, listunknown)
   315         r = ctx2._prestatus(ctx1, r, match, listignored, listclean, listunknown)
   318         r = ctx2._buildstatus(ctx1, r, match, listignored, listclean,
   316         r = ctx2._buildstatus(ctx1, r, match, listignored, listclean,
   319                               listunknown)
   317                               listunknown)
   320         r = ctx2._poststatus(ctx1, r, match, listignored, listclean,
   318         r = ctx2._poststatus(ctx1, r, match, listignored, listclean,
   321                              listunknown)
   319                              listunknown)
  1470             s = super(workingctx, self)._buildstatus(other, s, match,
  1468             s = super(workingctx, self)._buildstatus(other, s, match,
  1471                                                      listignored, listclean,
  1469                                                      listignored, listclean,
  1472                                                      listunknown)
  1470                                                      listunknown)
  1473         return s
  1471         return s
  1474 
  1472 
  1475     def _matchstatus(self, other, s, match, listignored, listclean,
  1473     def _matchstatus(self, other, match):
  1476                      listunknown):
       
  1477         """override the match method with a filter for directory patterns
  1474         """override the match method with a filter for directory patterns
  1478 
  1475 
  1479         We use inheritance to customize the match.bad method only in cases of
  1476         We use inheritance to customize the match.bad method only in cases of
  1480         workingctx since it belongs only to the working directory when
  1477         workingctx since it belongs only to the working directory when
  1481         comparing against the parent changeset.
  1478         comparing against the parent changeset.
  1482 
  1479 
  1483         If we aren't comparing against the working directory's parent, then we
  1480         If we aren't comparing against the working directory's parent, then we
  1484         just use the default match object sent to us.
  1481         just use the default match object sent to us.
  1485         """
  1482         """
  1486         superself = super(workingctx, self)
  1483         superself = super(workingctx, self)
  1487         match = superself._matchstatus(other, s, match, listignored, listclean,
  1484         match = superself._matchstatus(other, match)
  1488                                        listunknown)
       
  1489         if other != self._repo['.']:
  1485         if other != self._repo['.']:
  1490             def bad(f, msg):
  1486             def bad(f, msg):
  1491                 # 'f' may be a directory pattern from 'match.files()',
  1487                 # 'f' may be a directory pattern from 'match.files()',
  1492                 # so 'f not in ctx1' is not enough
  1488                 # so 'f not in ctx1' is not enough
  1493                 if f not in other and f not in other.dirs():
  1489                 if f not in other and f not in other.dirs():