Commits

Kevin Bullock committed c149261

tag: don't check .hgtags status if --local passed

Local tags don't create a commit, so we don't need to check the status
of .hgtags.

  • Participants
  • Parent commits dbc5468
  • Branches stable

Comments (0)

Files changed (2)

File mercurial/localrepo.py

 
         date: date tuple to use if committing'''
 
-        for x in self.status()[:5]:
-            if '.hgtags' in x:
-                raise util.Abort(_('working copy of .hgtags is changed '
-                                   '(please commit .hgtags manually)'))
+        if not local:
+            for x in self.status()[:5]:
+                if '.hgtags' in x:
+                    raise util.Abort(_('working copy of .hgtags is changed '
+                                       '(please commit .hgtags manually)'))
 
         self.tags() # instantiate the cache
         self._tag(names, node, message, local, user, date)

File tests/test-tag.t

   $ hg log -l1 --template "{desc}\n"
   custom tag message
   second line
+
+local tag with .hgtags modified
+
+  $ hg tag hgtags-modified
+  $ hg rollback
+  rolling back to revision 11 (undo commit)
+  $ hg st
+  M .hgtags
+  ? .hgtags.orig
+  ? editor
+  $ hg tag --local baz
+  $ hg revert --no-backup .hgtags