* Mono.Documentation/exceptions.cs: Add
authorJonathan Pryor <jpryor@novell.com>
Mon, 30 Mar 2009 13:11:55 +0000 (13:11 -0000)
committerJonathan Pryor <jpryor@novell.com>
Mon, 30 Mar 2009 13:11:55 +0000 (13:11 -0000)
  ExceptionLocations.AddedMember, used for --exceptions=added support.
* Mono.Documentation/monodocer.cs: Add --exceptions=added, which will
  only add <exception/> elements for newly added elements.  This is
  useful for updating documentation for established projects which
  already have <exception/> corrections (e.g. *removal* of
  <exception/> elements because the exceptions weren't actually
  possible), so only new members should have <exception/> created.

svn path=/trunk/mcs/; revision=130551

mcs/tools/mdoc/ChangeLog
mcs/tools/mdoc/Mono.Documentation/exceptions.cs
mcs/tools/mdoc/Mono.Documentation/monodocer.cs

index e6204e773a08c34309d9fdc79eab1da50aec9d4c..46ecc82b319eb08444bebcbb58052bd4c4760f07 100644 (file)
@@ -1,3 +1,14 @@
+2009-03-29  Jonathan Pryor <jpryor@novell.com>
+
+       * Mono.Documentation/exceptions.cs: Add
+         ExceptionLocations.AddedMember, used for --exceptions=added support.
+       * Mono.Documentation/monodocer.cs: Add --exceptions=added, which will 
+         only add <exception/> elements for newly added elements.  This is
+         useful for updating documentation for established projects which
+         already have <exception/> corrections (e.g. *removal* of
+         <exception/> elements because the exceptions weren't actually
+         possible), so only new members should have <exception/> created.
+
 2009-03-20  Jonathan Pryor <jpryor@novell.com>
 
        * Mono.Documentation/monodocs2html.cs: Perform the timestamp check for
index 9fa03544b9fdbcbcd088e595a9758810f242aadd..ad1ba9d76ae832a258c585cd8964d6e9761301b0 100644 (file)
@@ -40,7 +40,7 @@ namespace Mono.Documentation {
                Member              = 0x0,
                Assembly            = 0x1,
                DependentAssemblies = 0x2,
-               All = Assembly | DependentAssemblies
+               AddedMembers        = 0x4,
        }
         
        public class ExceptionSources {
index 2434dc7eb9572986d6e0178e89e2457c2c02e09a..f29fb8ff85f1cf5dc064c0c42503abdb3fb014e3 100644 (file)
@@ -155,9 +155,10 @@ class MDocUpdater : MDocCommand
                        return loc;
                foreach (var type in s.Split (',')) {
                        switch (type) {
+                               case "added":   loc |= ExceptionLocations.AddedMembers; break;
+                               case "all":     loc |= ExceptionLocations.Assembly | ExceptionLocations.DependentAssemblies; break;
                                case "asm":     loc |= ExceptionLocations.Assembly; break;
                                case "depasm":  loc |= ExceptionLocations.DependentAssemblies; break;
-                               case "all":     loc = ExceptionLocations.All; break;
                                default:        throw new NotSupportedException ("Unsupported --exceptions value: " + type);
                        }
                }
@@ -1758,7 +1759,8 @@ class MDocUpdater : MDocCommand
                if (addremarks)
                        WriteElementInitialText(e, "remarks", "To be added.");
 
-               if (exceptions.HasValue && info.Member != null) {
+               if (exceptions.HasValue && info.Member != null &&
+                               (exceptions.Value & ExceptionLocations.AddedMembers) == 0) {
                        UpdateExceptions (e, info.Member);
                }
 
@@ -2404,6 +2406,9 @@ class MDocUpdater : MDocCommand
                
                info.Node = me;
                UpdateMember(info);
+               if (exceptions.HasValue && 
+                               (exceptions.Value & ExceptionLocations.AddedMembers) != 0)
+                       UpdateExceptions (info.Node, info.Member);
 
                if (since != null) {
                        XmlNode docs = me.SelectSingleNode("Docs");