[PATCH 3 of 8] localrepo: ignore always-empty 'unknown' files when looking for '.hgtags'

Martin von Zweigbergk martinvonz at gmail.com
Wed Oct 1 19:01:55 CDT 2014


# HG changeset patch
# User Martin von Zweigbergk <martinvonz at gmail.com>
# Date 1412196063 25200
#      Wed Oct 01 13:41:03 2014 -0700
# Node ID e1154b545f8411371124e7c24fd7e3f67c11dcba
# Parent  82b9c894095a9d739c25c42951ed1c7788b5ad90
localrepo: ignore always-empty 'unknown' files when looking for '.hgtags'

Since the call to self.status() does not request listing of unknown
files, that list will always be empty. Still, the lists of files
searched for '.hgtags' includes that list, but not the ignored and
clean files, which will also always be empty. This seems misleading,
so let's ignore the unknown files as well.

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -574,7 +574,7 @@
         date: date tuple to use if committing'''
 
         if not local:
-            for x in self.status()[:5]:
+            for x in self.status()[:4]:
                 if '.hgtags' in x:
                     raise util.Abort(_('working copy of .hgtags is changed '
                                        '(please commit .hgtags manually)'))


More information about the Mercurial-devel mailing list