~ubuntu-branches/ubuntu/oneiric/monodevelop/oneiric

« back to all changes in this revision

Viewing changes to src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/ChangeLogWriter.cs

  • Committer: Bazaar Package Importer
  • Author(s): Jo Shields
  • Date: 2011-06-27 17:03:13 UTC
  • mto: (1.8.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 54.
  • Revision ID: james.westby@ubuntu.com-20110627170313-6cvz3s19x6e9hqe9
ImportĀ upstreamĀ versionĀ 2.5.92+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
using System.IO;
31
31
using System.Text;
32
32
using System.Collections.Generic;
33
 
using MonoDevelop.Ide.Gui;
 
33
using System.Linq;
 
34
using MonoDevelop.Projects;
34
35
using MonoDevelop.Projects.Text;
35
36
 
36
37
using MonoDevelop.Core;
56
57
                        }
57
58
                        
58
59
                        string relative_path = GetRelativeEntryPath (path);
59
 
                        if (relative_path == null) {
 
60
                        if (relative_path == null)
60
61
                                return;
61
 
                        }
62
62
                        
63
63
                        List<string> path_list;
64
64
                        if (!messages.TryGetValue (message, out path_list)) {
110
110
                                fileSeparator2 = message_style.FileSeparator.Substring (si + 1);
111
111
                        }
112
112
                        
113
 
                        formatter.Wrap = WrappingType.Word;
 
113
                        formatter.Wrap = message_style.Wrap ? WrappingType.Word : WrappingType.None;
114
114
                        formatter.LeftMargin = message_style.LineAlign;
115
115
                        formatter.ParagraphStartMargin = 0;
116
116
                        
117
 
                        foreach (KeyValuePair<string, List<string>> message in messages) {
118
 
                                List<string> paths = message.Value;
119
 
                                paths.Sort ((a, b) => a.Length.CompareTo (b.Length));
120
 
                                
121
 
                                formatter.BeginWord ();
122
 
                                
123
 
                                formatter.Append (message_style.FirstFilePrefix);
124
 
                                for (int i = 0, n = paths.Count; i < n; i++) {
125
 
                                        if (i > 0) {
126
 
                                                formatter.Append (fileSeparator1);
127
 
                                                formatter.EndWord ();
128
 
                                                formatter.BeginWord ();
129
 
                                                formatter.Append (fileSeparator2);
 
117
                        if (!MessageFormat.ShowFilesForSingleComment && messages.Count == 1) {
 
118
                                string msg = messages.Keys.First ();
 
119
                                formatter.LeftMargin = formatter.ParagraphStartMargin;
 
120
                                formatter.Append (msg);
 
121
                        }
 
122
                        else {
 
123
                                foreach (KeyValuePair<string, List<string>> message in messages) {
 
124
                                        List<string> paths = message.Value;
 
125
                                        paths.Sort ((a, b) => a.Length.CompareTo (b.Length));
 
126
                                        
 
127
                                        formatter.BeginWord ();
 
128
                                        
 
129
                                        formatter.Append (message_style.FirstFilePrefix);
 
130
                                        for (int i = 0, n = paths.Count; i < n; i++) {
 
131
                                                if (i > 0) {
 
132
                                                        formatter.Append (fileSeparator1);
 
133
                                                        formatter.EndWord ();
 
134
                                                        formatter.BeginWord ();
 
135
                                                        formatter.Append (fileSeparator2);
 
136
                                                }
 
137
                                                string path = paths [i];
 
138
                                                if (!MessageFormat.Style.IncludeDirectoryPaths)
 
139
                                                        path = Path.GetFileName (path);
 
140
 
 
141
                                                formatter.Append (path);
130
142
                                        }
131
 
                                        formatter.Append (paths [i]);
132
 
                                }
133
 
                                
134
 
                                formatter.Append (message_style.LastFilePostfix);
135
 
                                formatter.EndWord ();
136
 
                                formatter.Append (message.Key);
137
 
                                
138
 
                                if (m_i++ < messages.Count - 1) {
139
 
                                        formatter.AppendLine ();
140
 
                                        for (int n=0; n < message_style.InterMessageLines; n++)
 
143
                                        
 
144
                                        formatter.Append (message_style.LastFilePostfix);
 
145
                                        formatter.EndWord ();
 
146
                                        formatter.Append (message.Key);
 
147
                                        
 
148
                                        if (m_i++ < messages.Count - 1) {
141
149
                                                formatter.AppendLine ();
 
150
                                                for (int n=0; n < message_style.InterMessageLines; n++)
 
151
                                                        formatter.AppendLine ();
 
152
                                        }
142
153
                                }
143
154
                        }
144
155