Merge lp:~taktaktaktaktaktaktaktaktaktak/monodevelop-bzr/2.0 into lp:monodevelop-bzr

Proposed by Levi Bard
Status: Merged
Approved by: Jelmer Vernooij
Approved revision: 92
Merged at revision: not available
Proposed branch: lp:~taktaktaktaktaktaktaktaktaktak/monodevelop-bzr/2.0
Merge into: lp:monodevelop-bzr
Diff against target: 195 lines
6 files modified
BazaarCLibClient.cs (+22/-5)
BazaarClient.cs (+2/-0)
BazaarVersionControl.cs (+18/-0)
IBazaarClient.cs (+12/-0)
MonoDevelop.VersionControl.Bazaar.addin.xml (+5/-5)
monodevelop-bzr.mds (+4/-1)
To merge this branch: bzr merge lp:~taktaktaktaktaktaktaktaktaktak/monodevelop-bzr/2.0
Reviewer Review Type Date Requested Status
Jelmer Vernooij (community) Approve
Review via email: mp+12454@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Levi Bard (taktaktaktaktaktaktaktaktaktak) wrote :

Recent revisions on this branch contain fixes for stability, and a fix for one bug that would have blocked the addin from being loaded at all on some installations.

Revision history for this message
Jelmer Vernooij (jelmer) :
review: Approve
93. By levi <levi@apollo>

Merge trunk branch.

94. By levi <levi@apollo>

Merge changes from jelmer 2.0 branch.

95. By levi <levi@apollo>

Merge upstream mainline changes.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'BazaarCLibClient.cs'
2--- BazaarCLibClient.cs 2009-08-18 10:25:32 +0000
3+++ BazaarCLibClient.cs 2009-09-26 13:40:23 +0000
4@@ -58,6 +58,9 @@
5 [DllImport ("python2.5")]
6 private static extern int PyString_AsStringAndSize (IntPtr pystring, out IntPtr buffer, out int size);
7
8+ [DllImport ("python2.5")]
9+ private static extern void PyErr_Clear ();
10+
11 private static Regex unicodeRegex = new Regex (@"^\s*u'(?<realString>.*)'\s*$", RegexOptions.Compiled);
12 private static string StringFromPython (IntPtr pystring)
13 {
14@@ -107,6 +110,7 @@
15 if (0 == PyRun_SimpleString ("trace = ''.join(traceback.format_exception(sys.last_type, sys.last_value, sys.last_traceback))\n")) {
16 trace = StringFromPython (PyMapping_GetItemString (maindict, "trace"));
17 }
18+ PyErr_Clear ();
19
20 throw new BazaarClientException(string.Format ("Error running '{0}': {1}{2}", string.Format (command, format), Environment.NewLine, trace));
21 }
22@@ -116,6 +120,7 @@
23 return PyMapping_GetItemString (maindict, variable);
24 });
25 }
26+ PyErr_Clear ();
27
28 return rv;
29 }// run
30@@ -216,7 +221,7 @@
31 if (null == monitor){ monitor = new MonoDevelop.Core.ProgressMonitoring.NullProgressMonitor (); }
32 StringBuilder command = new StringBuilder ();
33 command.AppendLine ("mycmd = builtins.cmd_branch()");
34- command.AppendLine ("mycmd.outf = sys.stdout");
35+ command.AppendLine ("mycmd._setup_outf()");
36 command.AppendLine (string.Format ("mycmd.run('{0}','{1}')", branchLocation, localPath));
37
38 lock (lockme){ run (null, command.ToString ()); }
39@@ -509,7 +514,7 @@
40
41 StringBuilder command = new StringBuilder ();
42 command.AppendLine ("mycmd = builtins.cmd_merge()");
43- command.AppendLine ("mycmd.outf = sys.stdout");
44+ command.AppendLine ("mycmd._setup_outf()");
45 command.AppendLine (string.Format ("mycmd.run('{0}',{1},{4},None,False,None,{2},False,False,'{3}')",
46 mergeLocation, string.IsNullOrEmpty (revisionSpec)? "None": revisionSpec,
47 remember? "True": "False", localPath, overwrite? "True": "False"));
48@@ -525,7 +530,7 @@
49 if (null == monitor){ monitor = new MonoDevelop.Core.ProgressMonitoring.NullProgressMonitor (); }
50 StringBuilder command = new StringBuilder ();
51 command.AppendLine ("mycmd = builtins.cmd_pull()");
52- command.AppendLine ("mycmd.outf = sys.stdout");
53+ command.AppendLine ("mycmd._setup_outf()");
54 command.AppendLine (string.Format ("mycmd.run('{0}',{1},{2},None,False,'{3}')", pullLocation, remember? "True": "False", overwrite? "True": "False", localPath));
55
56 lock (lockme){ run (null, command.ToString ()); }
57@@ -539,7 +544,7 @@
58 if (null == monitor){ monitor = new MonoDevelop.Core.ProgressMonitoring.NullProgressMonitor (); }
59 StringBuilder command = new StringBuilder ();
60 command.AppendLine ("mycmd = builtins.cmd_push()");
61- command.AppendLine ("mycmd.outf = sys.stdout");
62+ command.AppendLine ("mycmd._setup_outf()");
63 command.AppendLine (string.Format ("mycmd.run('{0}',{2},{3},False,False,None,False,'{1}',None,False,False)",
64 pushLocation, localPath, remember? "True": "False", overwrite? "True": "False"));
65
66@@ -810,12 +815,24 @@
67 if (null == monitor){ monitor = new MonoDevelop.Core.ProgressMonitoring.NullProgressMonitor (); }
68 StringBuilder command = new StringBuilder ();
69 command.AppendLine ("mycmd = builtins.cmd_export()");
70- command.AppendLine ("mycmd.outf = sys.stdout");
71+ command.AppendLine ("mycmd._setup_outf()");
72 command.AppendLine (string.Format ("mycmd.run('{0}','{1}')", exportPath, localPath));
73
74 lock (lockme){ run (null, command.ToString ()); }
75
76 monitor.Log.WriteLine ("Exported to {0}", exportPath);
77 }// Export
78+
79+ public override bool IsMergePending (string localPath)
80+ {
81+ lock (lockme)
82+ {
83+ // HACK: However, this is the way bzrlib does it.
84+ string pending = StringFromPython (run (new List<string>{"pending"},
85+ "pending = str(len(workingtree.WorkingTree.open_containing('{0}')[0].get_parent_ids()))",
86+ localPath)[0]);
87+ return !pending.Equals ("1", StringComparison.Ordinal);
88+ }
89+ }// IsMergePending
90 }// BazaarCLibClient
91 }
92
93=== modified file 'BazaarClient.cs'
94--- BazaarClient.cs 2009-08-04 19:14:06 +0000
95+++ BazaarClient.cs 2009-09-26 13:40:23 +0000
96@@ -186,6 +186,8 @@
97
98 return false;
99 }// IsValidExportPath
100+
101+ public abstract bool IsMergePending (string localPath);
102 }
103
104 public class LocalStatus {
105
106=== modified file 'BazaarVersionControl.cs'
107--- BazaarVersionControl.cs 2009-08-18 10:25:32 +0000
108+++ BazaarVersionControl.cs 2009-09-26 13:40:23 +0000
109@@ -241,6 +241,24 @@
110 }// Pull
111
112 public void Commit (ChangeSet changeSet, IProgressMonitor monitor) {
113+ if (Client.IsMergePending (Path.GetFullPath (changeSet.BaseLocalPath))) {
114+ int result = (int)ResponseType.Cancel;
115+ MonoDevelop.Core.Gui.DispatchService.GuiSyncDispatch(delegate{
116+ MessageDialog warningDialog = new MessageDialog (null, DialogFlags.Modal, MessageType.Warning, ButtonsType.OkCancel,
117+ GettextCatalog.GetString ("Because there are merges pending, all pending changes must be committed together. Proceed?"));
118+ result = warningDialog.Run ();
119+ warningDialog.Destroy ();
120+ });// Warn user, see if she wants to proceed
121+ if ((int)ResponseType.Ok == result) {
122+ ChangeSet newChangeSet = changeSet.Repository.CreateChangeSet (changeSet.BaseLocalPath);
123+ newChangeSet.GlobalComment = changeSet.GlobalComment;
124+ changeSet = newChangeSet;
125+ } else {
126+ monitor.Log.WriteLine (GettextCatalog.GetString ("Aborted by user."));
127+ return;
128+ }
129+ }// if there are merges pending commit
130+
131 Client.Commit (changeSet, monitor);
132 foreach (ChangeSetItem csi in changeSet.Items) {
133 FileService.NotifyFileChanged (csi.LocalPath);
134
135=== modified file 'IBazaarClient.cs'
136--- IBazaarClient.cs 2009-08-04 19:14:06 +0000
137+++ IBazaarClient.cs 2009-09-26 13:40:23 +0000
138@@ -390,5 +390,17 @@
139 /// A <see cref="IProgressMonitor"/>
140 /// </param>
141 void Export (string localPath, string exportPath, IProgressMonitor monitor);
142+
143+ /// <summary>
144+ /// Determines whether the current working tree has
145+ /// a merge pending commit.
146+ /// </summary>
147+ /// <param name="localPath">
148+ /// A <see cref="System.String"/>: A path in the local working tree
149+ /// </param>
150+ /// <returns>
151+ /// A <see cref="System.Boolean"/>: Whether a merge is pending
152+ /// </returns>
153+ bool IsMergePending (string localPath);
154 }
155 }
156
157=== modified file 'MonoDevelop.VersionControl.Bazaar.addin.xml'
158--- MonoDevelop.VersionControl.Bazaar.addin.xml 2009-08-18 10:25:32 +0000
159+++ MonoDevelop.VersionControl.Bazaar.addin.xml 2009-09-26 13:40:23 +0000
160@@ -13,11 +13,11 @@
161 </Runtime>
162
163 <Dependencies>
164- <Addin id="Core" version="2.0.0"/>
165- <Addin id="Core.Gui" version="2.0.0"/>
166- <Addin id="Projects" version="2.0.0"/>
167- <Addin id="Ide" version="2.0.0"/>
168- <Addin id="VersionControl" version="2.0.0"/>
169+ <Addin id="Core" version="2.0"/>
170+ <Addin id="Core.Gui" version="2.0"/>
171+ <Addin id="Projects" version="2.0"/>
172+ <Addin id="Ide" version="2.0"/>
173+ <Addin id="VersionControl" version="2.0"/>
174 </Dependencies>
175
176 <Extension path = "/MonoDevelop/VersionControl/VersionControlSystems">
177
178=== modified file 'monodevelop-bzr.mds'
179--- monodevelop-bzr.mds 2009-04-07 13:54:46 +0000
180+++ monodevelop-bzr.mds 2009-09-26 13:40:23 +0000
181@@ -1,4 +1,7 @@
182 <Combine fileversion="2.0" name="monodevelop-bzr">
183+ <Policies>
184+ <StandardHeader inheritsSet="GPLv2License" />
185+ </Policies>
186 <Configurations active="Debug">
187 <Configuration name="Debug" ctype="CombineConfiguration">
188 <Entry build="True" name="monodevelop-bzr" configuration="Debug" />
189@@ -13,4 +16,4 @@
190 <Entries>
191 <Entry filename="monodevelop-bzr.mdp" />
192 </Entries>
193-</Combine>
194+</Combine>
195\ No newline at end of file

Subscribers

People subscribed via source and target branches