Jens Alfke avatar Jens Alfke committed 2945d81 Merge

Merge

Comments (0)

Files changed (5)

 4fcf8b49cec769aaa6d26e18071b6bf1dd7fb696 0.6
 374ce852745a8bc6c950cdd3c6cdd5a72cd93543 0.6.1
 9d1b61c8f6d4d5c8c3c034960e8b0eb6a6eb4d84 0.6.2
+19ee46da3dfd9be73484b2f199d1281314ebc2bd 0.6.3
+9fd94b57ec4de349738f99a664a604e608cba2a9 icon set
+0000000000000000000000000000000000000000 icon set
+f608497647becaab79e2f6f40c096bb472f5ba58 terminal
+0000000000000000000000000000000000000000 terminal

English.lproj/MainMenu.xib

 							</object>
 						</object>
 					</object>
+					<object class="NSMenuItem" id="586577488">
+						<reference key="NSMenu" ref="649796088"/>
+						<string key="NSTitle">View</string>
+						<string key="NSKeyEquiv"/>
+						<int key="NSKeyEquivModMask">1048576</int>
+						<int key="NSMnemonicLoc">2147483647</int>
+						<reference key="NSOnImage" ref="664567982"/>
+						<reference key="NSMixedImage" ref="578101116"/>
+						<string key="NSAction">submenuAction:</string>
+						<object class="NSMenu" key="NSSubmenu" id="466310130">
+							<string key="NSTitle">View</string>
+							<object class="NSMutableArray" key="NSMenuItems">
+								<bool key="EncodedWithXMLCoder">YES</bool>
+								<object class="NSMenuItem" id="815551109">
+									<reference key="NSMenu" ref="466310130"/>
+									<string key="NSTitle">Hide Unmodified Files</string>
+									<string key="NSKeyEquiv">u</string>
+									<int key="NSKeyEquivModMask">1572864</int>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="664567982"/>
+									<reference key="NSMixedImage" ref="578101116"/>
+								</object>
+								<object class="NSMenuItem" id="702416646">
+									<reference key="NSMenu" ref="466310130"/>
+									<bool key="NSIsDisabled">YES</bool>
+									<bool key="NSIsSeparator">YES</bool>
+									<string key="NSTitle"/>
+									<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="102151532">
+									<reference key="NSMenu" ref="466310130"/>
+									<string key="NSTitle">Show Toolbar</string>
+									<string key="NSKeyEquiv">t</string>
+									<int key="NSKeyEquivModMask">1572864</int>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="664567982"/>
+									<reference key="NSMixedImage" ref="578101116"/>
+								</object>
+								<object class="NSMenuItem" id="237841660">
+									<reference key="NSMenu" ref="466310130"/>
+									<string key="NSTitle">Customize Toolbar…</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>
+						</object>
+					</object>
 					<object class="NSMenuItem" id="626404410">
 						<reference key="NSMenu" ref="649796088"/>
 						<string key="NSTitle">Revision</string>
 							</object>
 						</object>
 					</object>
-					<object class="NSMenuItem" id="586577488">
-						<reference key="NSMenu" ref="649796088"/>
-						<string key="NSTitle">View</string>
-						<string key="NSKeyEquiv"/>
-						<int key="NSKeyEquivModMask">1048576</int>
-						<int key="NSMnemonicLoc">2147483647</int>
-						<reference key="NSOnImage" ref="664567982"/>
-						<reference key="NSMixedImage" ref="578101116"/>
-						<string key="NSAction">submenuAction:</string>
-						<object class="NSMenu" key="NSSubmenu" id="466310130">
-							<string key="NSTitle">View</string>
-							<object class="NSMutableArray" key="NSMenuItems">
-								<bool key="EncodedWithXMLCoder">YES</bool>
-								<object class="NSMenuItem" id="815551109">
-									<reference key="NSMenu" ref="466310130"/>
-									<string key="NSTitle">Hide Unmodified Files</string>
-									<string key="NSKeyEquiv">u</string>
-									<int key="NSKeyEquivModMask">1572864</int>
-									<int key="NSMnemonicLoc">2147483647</int>
-									<reference key="NSOnImage" ref="664567982"/>
-									<reference key="NSMixedImage" ref="578101116"/>
-								</object>
-								<object class="NSMenuItem" id="702416646">
-									<reference key="NSMenu" ref="466310130"/>
-									<bool key="NSIsDisabled">YES</bool>
-									<bool key="NSIsSeparator">YES</bool>
-									<string key="NSTitle"/>
-									<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="102151532">
-									<reference key="NSMenu" ref="466310130"/>
-									<string key="NSTitle">Show Toolbar</string>
-									<string key="NSKeyEquiv">t</string>
-									<int key="NSKeyEquivModMask">1572864</int>
-									<int key="NSMnemonicLoc">2147483647</int>
-									<reference key="NSOnImage" ref="664567982"/>
-									<reference key="NSMixedImage" ref="578101116"/>
-								</object>
-								<object class="NSMenuItem" id="237841660">
-									<reference key="NSMenu" ref="466310130"/>
-									<string key="NSTitle">Customize Toolbar…</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>
-						</object>
-					</object>
 					<object class="NSMenuItem" id="713487014">
 						<reference key="NSMenu" ref="649796088"/>
 						<string key="NSTitle">Window</string>
 							<reference ref="694149608"/>
 							<reference ref="391199113"/>
 							<reference ref="379814623"/>
-							<reference ref="586577488"/>
 							<reference ref="626404410"/>
 							<reference ref="952259628"/>
+							<reference ref="586577488"/>
 						</object>
 						<reference key="parent" ref="0"/>
 						<string key="objectName">MainMenu</string>
 					<string>{74, 862}</string>
 					<string>{{71, 836}, {426, 20}}</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
-					<string>{{754, 997}, {238, 73}}</string>
+					<string>{{536, 763}, {238, 73}}</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<string>{{315, 763}, {241, 73}}</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>

Resources/Info.plist

 	<key>CFBundleSignature</key>
 	<string>????</string>
 	<key>CFBundleVersion</key>
-	<string>0.6.2</string>
+	<string>0.6.3</string>
 	<key>CFBundleShortVersionString</key>
-	<string>0.6.2</string>
+	<string>0.6.3</string>
 	<key>NSMainNibFile</key>
 	<string>MainMenu</string>
 	<key>NSPrincipalClass</key>

Source/RepoController_Actions.m

 - (IBAction) showRevision: (id)sender
 {
     HgFile *file = self.selectedFile;
-    if( !file.isFile || file!=self.actuallySelectedFile ) {
+    if( !(file.isFile || file.isDirectory) || file!=self.actuallySelectedFile ) {
         NSBeep();
         return;
     }
-    NSError *error;
-    NSString *path = [file.revision getPathToFileContents: file
-                                                inTempDir: self.tempDir
-                                                    error: &error];
-    if (!path) {
-        [self presentError: error];
-        return;
+    
+    NSString *path = nil;
+    if( file.isFile ) {
+        NSError *error;
+        path = [file.revision getPathToFileContents: file
+                                   inTempDir: self.tempDir
+                                       error: &error];
+        if (!path) {
+            [self presentError: error];
+            return;
+        }
     }
+    else if( file.isDirectory ) {
+        path = file.absolutePath;
+    }
+    
     if (![[NSWorkspace sharedWorkspace] openFile: path])
         NSBeep();
 }
     }
     [_pushURLField setStringValue: (defaultURL ?:@"")];
     [_pushURLField removeAllItems];
-    if( defaultURL )
+    // EW: Removed the if-check because this is not correct.
+    // It is possible to have a list of paths that lack a "default" option.
+    // (I sometimes remove the default entries to avoid accidentally pushing/pulling from the wrong repo.)
+    // In this case, this check will prevent the other paths in the list from showing up in the GUI.
+//    if( defaultURL )
     [_pushURLField addItemsWithObjectValues: [_repo.configFile URLsForStanza: @"paths"]];
     
     [_pushDescriptionField setObjectValue: desc];
     [sheet orderOut: self];
     if( returnCode != NSOKButton )
         return;
-    
-    NSURL *url = _pushURLField.objectValue;
+
+    // EW: objectValue may now return either an NSURL or NSString due to my changes.
+	// If an NSString is returned, my assumption is that it is a relative path like @"../MySource".
+    id some_value = _pushURLField.objectValue;
+    NSURL *url;
+	
+    // Should only be a NSString holding a relative path or a NSURL
+    if( [some_value isKindOfClass: [NSString class]] ) {
+        NSString* combined_string = [[self.directory stringByAppendingString:some_value] stringByStandardizingPath];
+        url = [NSURL fileURLWithPath:combined_string];
+	} else {
+        url = (NSURL*)some_value;
+	}
     if( ! url )
         return;
-    
+        
     HgTransferOp xferOp = (HgTransferOp)(size_t)context;
     HgTransferOptions options = 0;
     if( _pullUpdateCheckbox.state )

Source/URLFormatter.m

 }
 
 
-
+// EW: Needed to change implementation to handle relative paths.
+// Because this converted an NSURL (from an original string) to a NSString,
+// the information about whether the path was relative or not was lost.
+// So my changes allow for an NSString to not be converted to a NSURL
+// and then I just return the string if that's the case. This string will
+// be a relative path like @"../MySource".
 - (NSString *)stringForObjectValue:(id)obj
 {
-    if( ! [obj isKindOfClass: [NSURL class]] )
+    if( [obj isKindOfClass: [NSString class]] )
+        return obj;
+    else if( ! [obj isKindOfClass: [NSURL class]] )
         return @"";
     else if( [obj isFileURL] )
         return [obj path];
         *obj = [NSURL fileURLWithPath: str];
         if( ! *obj )
             error = @"Invalid filesystem path";
-    } else {
+    } else if( [str hasPrefix: @".."] ) {
+        /* This check is needed for relative paths, e.g. ../MySource.
+           A better implemention should be added to handle relative paths in the middle of the string.
+		   Instead of returning an NSURL, I return an NSString because this code gets called by
+		   stringForObjectValue which then converts it back to an NSString. The double conversion
+		   was causing information to be lost about whether the NSURL was a relative path or not.
+        */
+        NSString* expanded_string = [str stringByStandardizingPath];
+        *obj = expanded_string;
+        if( ! *obj )
+            error = @"Invalid filesystem path";
+    } else {        
         NSURL *url = [NSURL URLWithString: str];
         NSString *scheme = [url scheme];
         if( url && scheme == nil ) {
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.