##// END OF EJS Templates
status: clean up all users for unknown files
Matt Mackall -
r6760:4faaa053 default
parent child Browse files
Show More
@@ -122,8 +122,7 b' def dodiff(ui, repo, diffcmd, diffopts, '
122 122 '''
123 123 node1, node2 = cmdutil.revpair(repo, opts['rev'])
124 124 matcher = cmdutil.match(repo, pats, opts)
125 modified, added, removed, deleted, unknown = repo.status(
126 node1, node2, matcher)[:5]
125 modified, added, removed = repo.status(node1, node2, matcher)[:3]
127 126 if not (modified or added or removed):
128 127 return 0
129 128
@@ -239,7 +239,7 b' def sign(ui, repo, *revs, **opts):'
239 239 repo.opener("localsigs", "ab").write(sigmessage)
240 240 return
241 241
242 for x in repo.status()[:5]:
242 for x in repo.status(unknown=True)[:5]:
243 243 if ".hgsigs" in x and not opts["force"]:
244 244 raise util.Abort(_("working copy of .hgsigs is changed "
245 245 "(please commit .hgsigs manually "
@@ -55,9 +55,7 b' def difftree(ui, repo, node1=None, node2'
55 55 mmap = repo[node1].manifest()
56 56 mmap2 = repo[node2].manifest()
57 57 m = cmdutil.match(repo, files)
58 status = repo.status(node1, node2, match=m)[:5]
59 modified, added, removed, deleted, unknown = status
60
58 modified, added, removed = repo.status(node1, node2, m)[:3]
61 59 empty = short(nullid)
62 60
63 61 for f in modified:
@@ -253,12 +253,12 b' class kwfilelog(filelog.filelog):'
253 253 return t2 != text
254 254 return revlog.revlog.cmp(self, node, text)
255 255
256 def _status(ui, repo, kwt, *pats, **opts):
256 def _status(ui, repo, kwt, unknown, *pats, **opts):
257 257 '''Bails out if [keyword] configuration is not active.
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, clean=True)
261 return repo.status(match=matcher, unknown=unknown, 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'))
@@ -268,15 +268,15 b' def _kwfwrite(ui, repo, expand, *pats, *'
268 268 if repo.dirstate.parents()[1] != nullid:
269 269 raise util.Abort(_('outstanding uncommitted merge'))
270 270 kwt = kwtools['templater']
271 status = _status(ui, repo, kwt, *pats, **opts)
272 modified, added, removed, deleted, unknown, ignored, clean = status
271 status = _status(ui, repo, kwt, False, *pats, **opts)
272 modified, added, removed, deleted = status[:4]
273 273 if modified or added or removed or deleted:
274 274 raise util.Abort(_('outstanding uncommitted changes'))
275 275 wlock = lock = None
276 276 try:
277 277 wlock = repo.wlock()
278 278 lock = repo.lock()
279 kwt.overwrite(None, expand, clean)
279 kwt.overwrite(None, expand, status[6])
280 280 finally:
281 281 del wlock, lock
282 282
@@ -380,11 +380,9 b' def files(ui, repo, *pats, **opts):'
380 380 That is, files matched by [keyword] config patterns but not symlinks.
381 381 '''
382 382 kwt = kwtools['templater']
383 status = _status(ui, repo, kwt, *pats, **opts)
383 status = _status(ui, repo, kwt, opts.get('untracked'), *pats, **opts)
384 384 modified, added, removed, deleted, unknown, ignored, clean = status
385 files = modified + added + clean
386 if opts.get('untracked'):
387 files += unknown
385 files = modified + added + clean + unknown
388 386 files.sort()
389 387 wctx = repo[None]
390 388 kwfiles = [f for f in files if kwt.iskwfile(f, wctx.flags)]
@@ -852,7 +852,7 b' class queue:'
852 852 self.ui.warn(_('cleaning up working directory...'))
853 853 node = repo.dirstate.parents()[0]
854 854 hg.revert(repo, node, None)
855 unknown = repo.status()[4]
855 unknown = repo.status(unknown=True)[4]
856 856 # only remove unknown files that we know we touched or
857 857 # created while patching
858 858 for f in unknown:
@@ -933,7 +933,7 b' class queue:'
933 933 qp = self.qparents(repo, rev)
934 934 changes = repo.changelog.read(qp)
935 935 mmap = repo.manifest.read(changes[0])
936 m, a, r, d, u = repo.status(qp, top)[:5]
936 m, a, r, d = repo.status(qp, top)[:4]
937 937 if d:
938 938 raise util.Abort("deletions found between repo revs")
939 939 for f in m:
@@ -1066,11 +1066,11 b' class queue:'
1066 1066 # patch already
1067 1067 #
1068 1068 # this should really read:
1069 # mm, dd, aa, aa2, uu = repo.status(tip, patchparent)[:5]
1069 # mm, dd, aa, aa2 = repo.status(tip, patchparent)[:4]
1070 1070 # but we do it backwards to take advantage of manifest/chlog
1071 1071 # caching against the next repo.status call
1072 1072 #
1073 mm, aa, dd, aa2, uu = repo.status(patchparent, tip)[:5]
1073 mm, aa, dd, aa2 = repo.status(patchparent, tip)[:4]
1074 1074 changes = repo.changelog.read(tip)
1075 1075 man = repo.manifest.read(changes[0])
1076 1076 aaa = aa[:]
@@ -1078,7 +1078,7 b' class queue:'
1078 1078 match = cmdutil.matchfiles(repo, mm + aa + dd)
1079 1079 else:
1080 1080 match = cmdutil.matchall(repo)
1081 m, a, r, d, u = repo.status(match=match)[:5]
1081 m, a, r, d = repo.status(match=match)[:4]
1082 1082
1083 1083 # we might end up with files that were added between
1084 1084 # tip and the dirstate parent, but then changed in the
@@ -1111,7 +1111,7 b' class queue:'
1111 1111 m = util.unique(mm)
1112 1112 r = util.unique(dd)
1113 1113 a = util.unique(aa)
1114 c = [filter(matchfn, l) for l in (m, a, r, [], u)]
1114 c = [filter(matchfn, l) for l in (m, a, r)]
1115 1115 match = cmdutil.matchfiles(repo, util.unique(c[0] + c[1] + c[2]))
1116 1116 patch.diff(repo, patchparent, match=match,
1117 1117 fp=patchf, changes=c, opts=self.diffopts())
@@ -405,8 +405,8 b' def dorecord(ui, repo, committer, *pats,'
405 405 if match.files():
406 406 changes = None
407 407 else:
408 changes = repo.status(match=match)[:5]
409 modified, added, removed = changes[:3]
408 changes = repo.status(match=match)[:3]
409 modified, added, removed = changes
410 410 match = cmdutil.matchfiles(repo, modified + added + removed)
411 411 diffopts = mdiff.diffopts(git=True, nodates=True)
412 412 fp = cStringIO.StringIO()
@@ -431,7 +431,7 b' def dorecord(ui, repo, committer, *pats,'
431 431
432 432 if changes is None:
433 433 match = cmdutil.matchfiles(repo, newfiles)
434 changes = repo.status(match=match)[:5]
434 changes = repo.status(match=match)
435 435 modified = dict.fromkeys(changes[0])
436 436
437 437 # 2. backup changed files, so we can restore them in the end
@@ -1158,8 +1158,7 b' def commit(ui, repo, commitfunc, pats, o'
1158 1158
1159 1159 m = match(repo, pats, opts)
1160 1160 if pats:
1161 status = repo.status(match=m)
1162 modified, added, removed, deleted, unknown = status[:5]
1161 modified, added, removed = repo.status(match=m)[:3]
1163 1162 files = modified + added + removed
1164 1163 slist = None
1165 1164 for f in m.files():
@@ -2197,7 +2197,7 b' def remove(ui, repo, *pats, **opts):'
2197 2197 raise util.Abort(_('no files specified'))
2198 2198
2199 2199 m = cmdutil.match(repo, pats, opts)
2200 mardu = map(dict.fromkeys, repo.status(match=m))[:5]
2200 mardu = map(dict.fromkeys, repo.status(match=m, unknown=True))[:5]
2201 2201 modified, added, removed, deleted, unknown = mardu
2202 2202
2203 2203 remove, forget = [], []
@@ -488,7 +488,7 b' class workingctx(changectx):'
488 488
489 489 def __getattr__(self, name):
490 490 if name == '_status':
491 self._status = self._repo.status()
491 self._status = self._repo.status(unknown=True)
492 492 return self._status
493 493 if name == '_manifest':
494 494 self._buildmanifest()
@@ -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 ignored=False, clean=False, unknown=True):
975 ignored=False, clean=False, unknown=False):
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.
@@ -1189,8 +1189,8 b' def diff(repo, node1=None, node2=None, m'
1189 1189 date1 = util.datestr(ctx1.date())
1190 1190
1191 1191 if not changes:
1192 changes = repo.status(node1, node2, match=match)[:5]
1193 modified, added, removed, deleted, unknown = changes
1192 changes = repo.status(node1, node2, match=match)
1193 modified, added, removed = changes[:3]
1194 1194
1195 1195 if not modified and not added and not removed:
1196 1196 return
General Comments 0
You need to be logged in to leave comments. Login now