Commits

Jens Alfke committed f4c0ef6

* Display number of conflicts in the file-status bar at the bottom left.
* Renamed "Compare Conflicts" to "Merge Conflict Again".
* Added the above command to the file context menu.

Comments (0)

Files changed (7)

English.lproj/Localizable.strings

 /* Error message from Open command */
 "%@ is not a directory" = "%@ is not a directory";
 
+/* View Mode Button Title Path singular */
+"%i conflict" = "%i conflict";
+
+/* View Mode Button Title Path */
+"%i conflicts" = "%i conflicts";
+
 /* Body of conflicts alert from Commit command */
 "%i file(s) still have unresolved merge conflicts. Please edit them to resolve the conflicting lines, then use the Mark As Resolved command to tell Mercurial that they've been resolved.\nAfter that, you can commit." = "%i file(s) still have unresolved merge conflicts. Please edit them to resolve the conflicting lines, then use the Mark As Resolved command to tell Mercurial that they've been resolved.\nAfter that, you can commit.";
 
 "%i file(s) you're trying to check in have not yet been added to the repository (status is '?'). These won't be checked in. Proceed anyway?" = "%i file(s) you're trying to check in have not yet been added to the repository (status is '?'). These won't be checked in. Proceed anyway?";
 
 /* View Mode Button Title Path singular */
-"%i Modified File" = "%i Modified File";
+"%i modified file" = "%i modified file";
 
 /* View Mode Button Title Path */
-"%i Modified Files" = "%i Modified Files";
+"%i modified files" = "%i modified files";
 
 /* Comment for unchanged current revision */
 "(no changes)" = "(no changes)";
 "..." = "...";
 
 /* View Mode Button Title Files */
-"All Files (%i modified)" = "All Files (%i modified)";
+"All Files (%@)" = "All Files (%@)";
 
 /* Body of generic merge error sheet */
 "An error occurred and the merge did not take place." = "An error occurred and the merge did not take place.";

English.lproj/MainMenu.strings

 /* Class = "NSMenuItem"; title = "Mark As Resolved"; ObjectID = "607"; */
 "607.title" = "Mark As Resolved";
 
-/* Class = "NSMenuItem"; title = "Compare Conflicts"; ObjectID = "610"; */
-"610.title" = "Compare Conflicts";
+/* Class = "NSMenuItem"; title = "Merge Conflict Again"; ObjectID = "610"; */
+"610.title" = "Merge Conflict Again";

English.lproj/MainMenu.xib

 									<reference key="NSOnImage" ref="664567982"/>
 									<reference key="NSMixedImage" ref="578101116"/>
 								</object>
-								<object class="NSMenuItem" id="3375322">
+								<object class="NSMenuItem" id="1059191347">
 									<reference key="NSMenu" ref="502084290"/>
-									<string key="NSTitle">Mark As Resolved</string>
+									<string key="NSTitle">Merge Conflict Again</string>
 									<string key="NSKeyEquiv"/>
 									<int key="NSKeyEquivModMask">1048576</int>
 									<int key="NSMnemonicLoc">2147483647</int>
 									<reference key="NSOnImage" ref="664567982"/>
 									<reference key="NSMixedImage" ref="578101116"/>
 								</object>
-								<object class="NSMenuItem" id="1059191347">
+								<object class="NSMenuItem" id="3375322">
 									<reference key="NSMenu" ref="502084290"/>
-									<string key="NSTitle">Compare Conflicts</string>
+									<string key="NSTitle">Mark As Resolved</string>
 									<string key="NSKeyEquiv"/>
 									<int key="NSKeyEquivModMask">1048576</int>
 									<int key="NSMnemonicLoc">2147483647</int>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
-					<string>{{511, 613}, {222, 223}}</string>
+					<string>{{511, 613}, {239, 223}}</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<string>{{233, 693}, {296, 143}}</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>

English.lproj/Repo.strings

 
 /* Class = "NSToolbarItem"; paletteLabel = "Merge"; ObjectID = "300404"; */
 "300404.paletteLabel" = "Merge";
+
+/* Class = "NSMenuItem"; title = "Merge Conflict Again"; ObjectID = "300406"; */
+"300406.title" = "Merge Conflict Again";

English.lproj/Repo.xib

 		</object>
 		<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
 			<bool key="EncodedWithXMLCoder">YES</bool>
+			<integer value="1"/>
 			<integer value="300117"/>
-			<integer value="1"/>
 		</object>
 		<object class="NSArray" key="IBDocument.PluginDependencies">
 			<bool key="EncodedWithXMLCoder">YES</bool>
 								<string key="NSToolbarItemPaletteLabel">Revision List</string>
 								<string key="NSToolbarItemToolTip">A list of all revisions in the repository.</string>
 								<object class="NSPopUpButton" key="NSToolbarItemView" id="296634478">
-									<reference key="NSNextResponder"/>
+									<nil key="NSNextResponder"/>
 									<int key="NSvFlags">268</int>
 									<string key="NSFrame">{{0, 14}, {100, 22}}</string>
-									<reference key="NSSuperview"/>
-									<reference key="NSWindow"/>
 									<bool key="NSEnabled">YES</bool>
 									<object class="NSPopUpButtonCell" key="NSCell" id="973976143">
 										<int key="NSCellFlags">-2076049856</int>
 								<string key="NSToolbarItemPaletteLabel">View Mode</string>
 								<string key="NSToolbarItemToolTip">Switches between a tree view of all files, and a flat view of only the files modified in this revision.</string>
 								<object class="NSSegmentedControl" key="NSToolbarItemView" id="38463917">
-									<reference key="NSNextResponder"/>
+									<nil key="NSNextResponder"/>
 									<int key="NSvFlags">268</int>
 									<string key="NSFrame">{{0, 14}, {71, 25}}</string>
-									<reference key="NSSuperview"/>
-									<reference key="NSWindow"/>
 									<bool key="NSEnabled">YES</bool>
 									<object class="NSSegmentedCell" key="NSCell" id="498867354">
 										<int key="NSCellFlags">67239424</int>
 						<reference key="NSOnImage" ref="705507820"/>
 						<reference key="NSMixedImage" ref="516194051"/>
 					</object>
+					<object class="NSMenuItem" id="976917881">
+						<reference key="NSMenu" ref="1043860070"/>
+						<string key="NSTitle">Merge Conflict Again</string>
+						<string key="NSKeyEquiv"/>
+						<int key="NSKeyEquivModMask">1048576</int>
+						<int key="NSMnemonicLoc">2147483647</int>
+						<reference key="NSOnImage" ref="705507820"/>
+						<reference key="NSMixedImage" ref="516194051"/>
+					</object>
 					<object class="NSMenuItem" id="818102785">
 						<reference key="NSMenu" ref="1043860070"/>
 						<bool key="NSIsDisabled">YES</bool>
 					</object>
 					<int key="connectionID">300405</int>
 				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">remergeFiles:</string>
+						<reference key="source" ref="798535885"/>
+						<reference key="destination" ref="976917881"/>
+					</object>
+					<int key="connectionID">300408</int>
+				</object>
 			</object>
 			<object class="IBMutableOrderedSet" key="objectRecords">
 				<object class="NSArray" key="orderedObjects">
 							<reference ref="262912880"/>
 							<reference ref="285480911"/>
 							<reference ref="1015050618"/>
+							<reference ref="976917881"/>
 						</object>
 						<reference key="parent" ref="0"/>
 					</object>
 						<reference key="object" ref="841820169"/>
 						<reference key="parent" ref="46956025"/>
 					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">300406</int>
+						<reference key="object" ref="976917881"/>
+						<reference key="parent" ref="1043860070"/>
+					</object>
 				</object>
 			</object>
 			<object class="NSMutableDictionary" key="flattenedProperties">
 					<string>300400.IBPluginDependency</string>
 					<string>300401.IBPluginDependency</string>
 					<string>300404.IBPluginDependency</string>
+					<string>300406.IBPluginDependency</string>
 					<string>6.IBPluginDependency</string>
 					<string>6.ImportedFromIB2</string>
 					<string>8.IBPluginDependency</string>
 					<bool key="EncodedWithXMLCoder">YES</bool>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<integer value="1"/>
-					<string>{{37, 313}, {800, 488}}</string>
+					<string>{{54, 313}, {800, 488}}</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
-					<string>{{37, 313}, {800, 488}}</string>
+					<string>{{54, 313}, {800, 488}}</string>
 					<integer value="1"/>
 					<string>{{166, 135}, {586, 488}}</string>
 					<boolean value="YES"/>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
-					<string>{{403, 623}, {236, 233}}</string>
+					<string>{{403, 603}, {236, 253}}</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<string>{{58, 562}, {239, 153}}</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<integer value="1"/>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<integer value="1"/>
 				</object>
 			</object>
 			<nil key="sourceID"/>
-			<int key="maxID">300405</int>
+			<int key="maxID">300408</int>
 		</object>
 		<object class="IBClassDescriber" key="IBDocument.Classes">
 			<object class="NSMutableArray" key="referencedPartialClassDescriptions">
 							<string>openSelectedFileInWindow:</string>
 							<string>pushPullRevisions:</string>
 							<string>refreshStatus:</string>
+							<string>remergeFiles:</string>
 							<string>removeFromRepository:</string>
 							<string>revealInFinder:</string>
 							<string>showComparison:</string>
 							<string>id</string>
 							<string>id</string>
 							<string>id</string>
+							<string>id</string>
 						</object>
 					</object>
 					<object class="NSMutableDictionary" key="actionInfosByName">
 							<string>openSelectedFileInWindow:</string>
 							<string>pushPullRevisions:</string>
 							<string>refreshStatus:</string>
+							<string>remergeFiles:</string>
 							<string>removeFromRepository:</string>
 							<string>revealInFinder:</string>
 							<string>showComparison:</string>
 								<string key="candidateClassName">id</string>
 							</object>
 							<object class="IBActionInfo">
+								<string key="name">remergeFiles:</string>
+								<string key="candidateClassName">id</string>
+							</object>
+							<object class="IBActionInfo">
 								<string key="name">removeFromRepository:</string>
 								<string key="candidateClassName">id</string>
 							</object>
 {
     "English.lproj/FileViewer.xib": "89b3ce19501369084592522616927d3e", 
-    "English.lproj/MainMenu.xib": "8a7e4fcada9f543995c542e3e6d07bca", 
+    "English.lproj/MainMenu.xib": "481b5b20475f1aedcf89bfc408754937", 
     "English.lproj/Projects.xib": "770fab372e314ce3a66f4c501d11d8ee", 
-    "English.lproj/Repo.xib": "5e5a74986e025440b9b7ed1220451e61", 
+    "English.lproj/Repo.xib": "1e2e2fb3346b88ab5cff231ba51d9549", 
     "French.lproj/FileViewer.strings": "3180f066f393da424f8f32f60384cedf", 
     "French.lproj/MainMenu.strings": "d54b312e76454c8742206c78acb4a7e8", 
     "French.lproj/Projects.strings": "7f3632a7668f39432d8dbf4ffb770f55", 

Source/RepoController.m

     [self setValue: _expandedPaths forSetting: @"ExpandedPaths"];
 }
 
+static NSString* modifiedString(unsigned n) {
+    if (n == 0)
+        return nil;
+    NSString *format;
+    if (n == 1)
+        format = NSLocalizedString(@"%i modified file", @"View Mode Button Title Path singular");
+    else 
+        format = NSLocalizedString(@"%i modified files", @"View Mode Button Title Path");
+    return [NSString stringWithFormat: format, n];
+}
+
+static NSString* conflictString(unsigned n) {
+    if (n == 0)
+        return nil;
+    NSString *format;
+    if (n == 1)
+        format = NSLocalizedString(@"%i conflict", @"View Mode Button Title Path singular");
+    else 
+        format = NSLocalizedString(@"%i conflicts", @"View Mode Button Title Path");
+    return [NSString stringWithFormat: format, n];
+}
+
 - (void) _updateViewModeButtonTitle
 {
-    NSString *viewModeTitle;
-    if (self.showsOnlyUncleanFiles) {
-        if (self.selectedRevision.uncleanFiles.count == 1) {
-            viewModeTitle = [NSString stringWithFormat: NSLocalizedString(@"%i Modified File", @"View Mode Button Title Path singular"),
-                             self.selectedRevision.uncleanFiles.count];
-        } else {
-            viewModeTitle = [NSString stringWithFormat: NSLocalizedString(@"%i Modified Files", @"View Mode Button Title Path"),
-                             self.selectedRevision.uncleanFiles.count];
-        }
-    } else {
-        viewModeTitle = [NSString stringWithFormat: NSLocalizedString(@"All Files (%i modified)", @"View Mode Button Title Files"),
-                         self.selectedRevision.uncleanFiles.count];
+    NSArray *modified = self.selectedRevision.uncleanFiles;
+    unsigned nConflicts = 0;
+    for (HgFile *file in modified)
+        if (file.mergeStatus == kConflict)
+            nConflicts++;
+    NSString *viewModeTitle = modifiedString(modified.count);
+    if (nConflicts > 0)
+        viewModeTitle = [viewModeTitle stringByAppendingFormat: @", %@", conflictString(nConflicts)];
+
+    if (!self.showsOnlyUncleanFiles) {
+        viewModeTitle = [NSString stringWithFormat: 
+                            NSLocalizedString(@"All Files (%@)", @"View Mode Button Title Files"),
+                            viewModeTitle];
     }
-    
     [_viewModeButton setTitle: viewModeTitle];
 }
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.