Show More
@@ -47,13 +47,12 b' def reposetup(ui, repo):' | |||
|
47 | 47 | # to recurse. |
|
48 | 48 | inotifyserver = False |
|
49 | 49 | |
|
50 |
def status(self, match, |
|
|
51 | list_unknown=True): | |
|
50 | def status(self, match, ignored, clean, unknown=True): | |
|
52 | 51 | files = match.files() |
|
53 | 52 | try: |
|
54 |
if not |
|
|
53 | if not ignored and not self.inotifyserver: | |
|
55 | 54 | result = client.query(ui, repo, files, match, False, |
|
56 |
|
|
|
55 | clean, unknown) | |
|
57 | 56 | if result is not None: |
|
58 | 57 | return result |
|
59 | 58 | except socket.error, err: |
@@ -82,15 +81,14 b' def reposetup(ui, repo):' | |||
|
82 | 81 | if query: |
|
83 | 82 | try: |
|
84 | 83 | return query(ui, repo, files or [], match, |
|
85 |
|
|
|
84 | ignored, clean, unknown) | |
|
86 | 85 | except socket.error, err: |
|
87 | 86 | ui.warn(_('could not talk to new inotify ' |
|
88 | 87 | 'server: %s\n') % err[1]) |
|
89 | 88 | ui.print_exc() |
|
90 | 89 | |
|
91 | 90 | return super(inotifydirstate, self).status( |
|
92 |
match, |
|
|
93 | list_unknown) | |
|
91 | match, ignored, clean, unknown) | |
|
94 | 92 | |
|
95 | 93 | repo.dirstate.__class__ = inotifydirstate |
|
96 | 94 |
@@ -11,7 +11,7 b' from mercurial import ui' | |||
|
11 | 11 | import common |
|
12 | 12 | import os, select, socket, stat, struct, sys |
|
13 | 13 | |
|
14 |
def query(ui, repo, names, match, |
|
|
14 | def query(ui, repo, names, match, ignored, clean, unknown=True): | |
|
15 | 15 | sock = socket.socket(socket.AF_UNIX) |
|
16 | 16 | sockpath = repo.join('inotify.sock') |
|
17 | 17 | sock.connect(sockpath) |
@@ -20,10 +20,10 b' def query(ui, repo, names, match, list_i' | |||
|
20 | 20 | for n in names or []: |
|
21 | 21 | yield n |
|
22 | 22 | states = 'almrx!' |
|
23 |
if |
|
|
23 | if ignored: | |
|
24 | 24 | raise ValueError('this is insanity') |
|
25 |
if |
|
|
26 |
if |
|
|
25 | if clean: states += 'n' | |
|
26 | if unknown: states += '?' | |
|
27 | 27 | yield states |
|
28 | 28 | |
|
29 | 29 | req = '\0'.join(genquery()) |
@@ -258,7 +258,7 b' def _status(ui, repo, kwt, *pats, **opts' | |||
|
258 | 258 | Returns status of working directory.''' |
|
259 | 259 | if kwt: |
|
260 | 260 | matcher = cmdutil.match(repo, pats, opts) |
|
261 |
return repo.status(match=matcher, |
|
|
261 | return repo.status(match=matcher, clean=True) | |
|
262 | 262 | if ui.configitems('keyword'): |
|
263 | 263 | raise util.Abort(_('[keyword] patterns cannot match')) |
|
264 | 264 | raise util.Abort(_('no [keyword] patterns configured')) |
@@ -629,7 +629,9 b' class dirstate(object):' | |||
|
629 | 629 | if imatch(k): |
|
630 | 630 | yield 'm', k, None |
|
631 | 631 | |
|
632 |
def status(self, match, |
|
|
632 | def status(self, match, ignored, clean, unknown): | |
|
633 | listignored, listclean, listunknown = ignored, clean, unknown | |
|
634 | ||
|
633 | 635 | lookup, modified, added, unknown, ignored = [], [], [], [], [] |
|
634 | 636 | removed, deleted, clean = [], [], [] |
|
635 | 637 | |
@@ -646,13 +648,12 b' class dirstate(object):' | |||
|
646 | 648 | dadd = deleted.append |
|
647 | 649 | cadd = clean.append |
|
648 | 650 | |
|
649 |
for src, fn, st in self.statwalk(match, |
|
|
650 | ignored=list_ignored): | |
|
651 | for src, fn, st in self.statwalk(match, listunknown, listignored): | |
|
651 | 652 | if fn not in dmap: |
|
652 |
if (list |
|
|
653 |
if list |
|
|
653 | if (listignored or match.exact(fn)) and self._dirignore(fn): | |
|
654 | if listignored: | |
|
654 | 655 | iadd(fn) |
|
655 |
elif list |
|
|
656 | elif listunknown: | |
|
656 | 657 | uadd(fn) |
|
657 | 658 | continue |
|
658 | 659 | |
@@ -685,7 +686,7 b' class dirstate(object):' | |||
|
685 | 686 | madd(fn) |
|
686 | 687 | elif time != int(st.st_mtime): |
|
687 | 688 | ladd(fn) |
|
688 |
elif list |
|
|
689 | elif listclean: | |
|
689 | 690 | cadd(fn) |
|
690 | 691 | elif state == 'm': |
|
691 | 692 | madd(fn) |
@@ -972,7 +972,7 b' class localrepository(repo.repository):' | |||
|
972 | 972 | yield fn |
|
973 | 973 | |
|
974 | 974 | def status(self, node1=None, node2=None, match=None, |
|
975 |
|
|
|
975 | ignored=False, clean=False, unknown=True): | |
|
976 | 976 | """return status of files between two nodes or node and working directory |
|
977 | 977 | |
|
978 | 978 | If node1 is None, use the first dirstate parent instead. |
@@ -994,6 +994,7 b' class localrepository(repo.repository):' | |||
|
994 | 994 | if not match: |
|
995 | 995 | match = match_.always(self.root, self.getcwd()) |
|
996 | 996 | |
|
997 | listignored, listclean, listunknown = ignored, clean, unknown | |
|
997 | 998 | modified, added, removed, deleted, unknown = [], [], [], [], [] |
|
998 | 999 | ignored, clean = [], [] |
|
999 | 1000 | |
@@ -1010,8 +1011,8 b' class localrepository(repo.repository):' | |||
|
1010 | 1011 | # are we comparing the working directory? |
|
1011 | 1012 | if not node2: |
|
1012 | 1013 | (lookup, modified, added, removed, deleted, unknown, |
|
1013 |
ignored, clean) = self.dirstate.status(match, list |
|
|
1014 |
list |
|
|
1014 | ignored, clean) = self.dirstate.status(match, listignored, | |
|
1015 | listclean, listunknown) | |
|
1015 | 1016 | # are we comparing working dir against its parent? |
|
1016 | 1017 | if compareworking: |
|
1017 | 1018 | if lookup: |
@@ -1025,7 +1026,7 b' class localrepository(repo.repository):' | |||
|
1025 | 1026 | modified.append(f) |
|
1026 | 1027 | else: |
|
1027 | 1028 | fixup.append(f) |
|
1028 |
if list |
|
|
1029 | if listclean: | |
|
1029 | 1030 | clean.append(f) |
|
1030 | 1031 | |
|
1031 | 1032 | # update dirstate for files that are actually clean |
@@ -1073,7 +1074,7 b' class localrepository(repo.repository):' | |||
|
1073 | 1074 | (mf1[fn] != mf2[fn] and |
|
1074 | 1075 | (mf2[fn] != "" or fcmp(fn, getnode)))): |
|
1075 | 1076 | modified.append(fn) |
|
1076 |
elif list |
|
|
1077 | elif listclean: | |
|
1077 | 1078 | clean.append(fn) |
|
1078 | 1079 | del mf1[fn] |
|
1079 | 1080 | else: |
General Comments 0
You need to be logged in to leave comments.
Login now