// // P4Message.m // Pulse // // Created by Matt Attaway on 2/16/14. // Copyright (c) 2014 Zen of the Monkey. All rights reserved. // #import "P4Message.h" @implementation P4Message - (id) init { self = [super init]; if(self) { self.results = [[NSMutableDictionary alloc] init]; self.list = [[NSMutableArray alloc] init]; } return self; } - (BOOL) isLoginError { BOOL loginError = false; if(!self.error) { return false; } if([self.error isEqual:@"Your session has expired, please login again.\n"] || [self.error isEqual:@"Perforce password (P4PASSWD) invalid or unset.\n"] ) { NSLog(@"I SHOULD PROBABLY ASK YOU FOR YOUR PASSWORD"); loginError = true; } return loginError; } - (BOOL) isUnicodeError { BOOL unicodeError = false; if(!self.error) { return false; } if ([self.error isEqual:@"Unicode server permits only unicode enabled clients.\n"] || [self.error isEqual:@"Unicode clients require a unicode enabled server.\n"] ) { NSLog(@"I SHOULD HAVE STUDIED OTHER LANGUAGES"); unicodeError = true; } return unicodeError; } - (BOOL)isConnectionError { BOOL connectionError = false; if(!self.error) { return false; } if([self.error hasPrefix: @"Perforce client error:"]) { NSLog(@"GAME OVER MAN, GAME OVER!"); connectionError = true; } return connectionError; } @end
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#7 | 8723 | Matt Attaway |
Continuously update state on opened files Automatically checking out files is all well and good, but there’s a problem; frequently in the course of working on files, before you commit, files will go through a number of different states. You may edit a file, then delete it, and then re-add it unchanged all before trying to commit. At the end of the process in the case above nothing should happen, but if you edit a file and never revisit it you are stuck with that initial edit. Pulse now runs a non-destructive revert on files when it receives an event notification. This resets the working state so that if there is a major change (from edit -> delete) we can properly catch it and tell the system. It also is handy for dealing with added files that you then delete. There are edge cases with this code that I’m confident are not handled correctly. The good news is nothing should be destructive; the worse that happens is you revert -k everything and re-run reconcile. User visible change |
||
#6 | 8655 | Matt Attaway |
Pull logging out of the message parsing helpers The logging was previously helpful, but now that I'm using those methods heavily it's just noise. No user visible change. |
||
#5 | 8597 | Matt Attaway |
Handle disconnected servers automatically If Pulse loses its connection with the Perforce server it now reports that the connection is down and starts a new timer to look for a live connection. The Overseer handles all of this on its own; unlike login there’s really nothing for the user to do. This change also fixes a bug where the login dialog was not being properly regenerated for connections after the first. User visible change |
||
#4 | 8595 | Matt Attaway |
WIP on handling connection errors With this change we report the errors to our delegate, but we don’t attempt to recover. That will come with the next checkin. This change does add in the protocol for handling these errors. User visible change |
||
#3 | 8575 | Matt Attaway |
Automatically handle Unicode servers; stub out login handling There's a lot going on in this change: * Fixed a bug where charset was always set to none * Added protocol on PLSOverseer so that something can properly handle login errors * PLSAppDelegate implements stubs for the PLSOverseer protocol * PLSOverseers automatically configure themselves for Unicode servers now * Ripped out handleCommonErrors: because it turns out I want to handle the same error in multiple ways. Next step is to properly handle 'p4 login' and request a password. User visible changes. |
||
#2 | 8574 | Matt Attaway |
Move message parsing smarts into P4Message. This minimizes how much PLSOverseer knows about Perforce which seems like a good thing from an architecture point of view and makes the P4 group more reusable. No functional change. |
||
#1 | 8569 | Matt Attaway |
Rejigger P4Connection to use a standard return type The previous mechanism made it hard to return anything but error messages. With the P4Message object we can return dictionaries, lists, and messages with a single object. I can use the new object more intelligently, but that’s for another change. I also reorganized the code to separate the ‘p4’ layer off into its own potentially reusable bucket. No functional change. |