cocoapsql-developer Mailing List for Cocoa PSQL
Status: Alpha
Brought to you by:
alkirkus
You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(27) |
Jun
(21) |
Jul
|
Aug
|
Sep
|
Oct
(3) |
Nov
(1) |
Dec
|
---|
From: Olaf v. O. <ol...@ad...> - 2002-11-11 06:01:59
|
Hi all, Continued working on drag and drop behavior of query's between the queryHistory view, the querySpace view and the queryDocument view. Finished "select by paragraph", "show insertion line" and "insert before or after paragraph". To do: (help is appreciated!) - draw a nicer insertLineMark - move (not copy) within the queryDocument if not control-draged - add the ability to add notes to every query in the queryDocument, ingnored when executed as query - add setter method (etc) for dragDestination behavior - clean up the code Further: have to add more (preferences): - "readline" behavior in querySpace view (ON/OFF) (assign preferred keys) - use (and save) of multiple connection sets - remember state of last closed query window (YES/NO) - remember state of last closed query document (YES/NO) - add database inspector window - add postmaster control Olaf. |
From: Olaf v. O. <ol...@ad...> - 2002-10-29 06:01:25
|
Isolated the Query window and QueryWindowController for multi window behavior. For the moment one can use only two Query windows. Will fully separate all App methods and Query window methods into two different classes. Will implement full multi window behavior. Will add DbInspector (multiple) window. Will change preferences to be able to hold more than one set of connection settings. Olaf |
From: Olaf v. O. <ol...@ad...> - 2002-10-27 17:03:22
|
added splitViews to the Query window: will add later - means to alter and save users preferred behavior of the querySpace and queryHisrory views. - saving and restoring window settings on quit and startup prepared queryHistory (now a PSQLTextView) for being a draggingSource when saving queries to a document. On mouseDown the query under the mouse pointer is selected On mouseDragged the selected query is copied to the pasteboard. An image representing the selection being dragged is shown under the mouse pointer. will add later: - the query being dragged must be of a custom "query"-type to distinct it from plain text. This to prevent the user from saving rubbish. - multi document support: multiple Query windows, Query (history) documents to be saved and Db inspector windows. Olaf |
From: Olaf v. O. <ol...@ad...> - 2002-10-07 05:01:23
|
modified autosizeing of last column in PSQLTableViewCat; added "readline" behaviour; replaced and resized queryHistory TextVieuw to show scrollbar; modified lines adding queries to the queryHistory view ensuring they are added to the end of the history and.. made sure that, if in there is an RETURN character the querySpace TextView the query will bet the paragraph, containing the insertion point, up to the RETURN character |
From: Olaf v. O. <ol...@ad...> - 2002-06-10 20:04:09
|
As cmd-C is reserved for Copy made the Connect button's keyEquivalent alt-cmd-C. |
From: Olaf v. O. <ol...@ad...> - 2002-06-10 20:04:06
|
Reconnected the Prefferences menu item outlet. Now to the PSQLController instance to have it work when there is no firstResponder available. Added setAutoenablesItems:YES to PSQLControler's awakeFormNib while the mainMenu.nib keeps forgetting the setting for the Connect menu and the Datamenu. |
From: Al K. <al...@ki...> - 2002-06-10 02:35:01
|
Hi Olaf. I just did a fresh checkout from cvs for cocoapsql. It compiled and ran although the preferences menu option was grayed out for some reason (the preferences panel opens properly in Interface Builder. I don't know what problems you encountered but they don't appear to have found their way into CVS. By the way, you should not have any cvswrappers files anywhere. There is one cvswrappers file in the CVSROOT directory but that directory should only exist in cvs, not on your local hard drive. Just wanted to let you know, See ya, Al On Sunday, June 9, 2002, at 04:22 AM, Olaf van Oudenallen wrote: > Hi Al, > > I am very sorry and I don't know how to put this nicely. > > When I commited and updated yesterday I got left with an empty > ConnPrefs.nib folder and a messed up MainMenu.nib (connections and > setting were lost). > > As I feel too that we have spend enough time on the CVS and especially > on the ConnPrefs.nib, I don't know what to do next. > > One thing I can think of is that I will > - try to remove the objects.nib files from the nibs and add them again > as binary or > - rename the nibs to be used from now on forward ad add them with the > objects.nib as binary. > I could try to add my new nib in this fashion first and see how it > works. > For now I will not be able to contribute anymore as there seems to be > no way to go around the cvswrappers file in the CVSROOT. > > See you, Olaf > > > > _______________________________________________________________ > > Don't miss the 2002 Sprint PCS Application Developer's Conference > August 25-28 in Las Vegas - > http://devcon.sprintpcs.com/adp/index.cfm?source=osdntextlink > > _______________________________________________ > Cocoapsql-developer mailing list > Coc...@li... > https://lists.sourceforge.net/lists/listinfo/cocoapsql-developer |
From: Olaf v. O. <ol...@ad...> - 2002-06-09 09:21:18
|
Hi Al, I am very sorry and I don't know how to put this nicely. When I commited and updated yesterday I got left with an empty ConnPrefs.nib folder and a messed up MainMenu.nib (connections and setting were lost). As I feel too that we have spend enough time on the CVS and especially on the ConnPrefs.nib, I don't know what to do next. One thing I can think of is that I will - try to remove the objects.nib files from the nibs and add them again as binary or - rename the nibs to be used from now on forward ad add them with the objects.nib as binary. I could try to add my new nib in this fashion first and see how it works. For now I will not be able to contribute anymore as there seems to be no way to go around the cvswrappers file in the CVSROOT. See you, Olaf |
From: Al K. <al...@ki...> - 2002-06-09 00:50:54
|
Hi Olaf. I was thinking about the tableview and autosizing the columns. Is there any reason that we can not autosize the columns as needed instead of autosizing against the first x columns when the table is initially setup. What I mean is why not just autosize for the currently listed records and when someone scrolls check the sizes as the rows are being fetched from the datasource. I need to think about the details but this seems like a far more efficient and accurate way of dealing with the problem. Thoughts? Al On Saturday, June 8, 2002, at 01:24 PM, Olaf van Oudenallen wrote: > Moved the autoSizeColums from PSQLController.m to a new Catergory > PSQLTableViewCat so the method will be available to all NSTableView's. > Modified the method to be prepaired for the use of a formatter on > NSTableColumn's dataCell (not tested!). Further the method name is > altered and can point to one column or all (-1). The maximum number of > rows to be processed is part of the method name as well. > "PSQLTableViewCat" Grouped these files and the PSQLTextView files to > the new Group "ClassExtensions" in the project. > Added the choice to autosize one or all columns. > > Added to PSQLController.m #import "PSQLTableViewCat.h" > Modified PSQLController submitQuery and setTableShouldAutoSizeColums: > [self autoSizeTableColumns]; > now is > [tableView autoSizePSQLTableColumn:-1 maxRows:200]; > > PSQLTableViewCat.h > #import <AppKit/NSTableView.h> > > @interface NSTableView ( PSQLTableView ) > - (void)autoSizePSQLTableColumn:(int)cn maxRows:(int)r; > @end > > PSQLTableViewCat.m > #import "PSQLTableViewCat.h" > #import <Cocoa/Cocoa.h> > > @implementation NSTableView ( PSQLTableView ) > - (void)autoSizePSQLTableColumn:(int)cn maxRows:(int)r { > NSFont *dataCellsFont; > NSDictionary *attributes; > NSSize cellToCellSpacing, cellsSize; > float cellWidthFitsAll; > int i, j, firstColumn, lastColumn; > NSArray *curColumns = [self tableColumns]; > id curColId; > id datSo = [self dataSource]; > id formatter; > NSString *valueWithFormat; > // need access to dataSource's method > tableView:objectValueForTableColumn:row: > SEL targetMethod = > @selector(tableView:objectValueForTableColumn:row:); > if ( ![datSo respondsToSelector:targetMethod] ) { > NSLog(@"PSQLTableViewCat: need > tableView:objectValueForTableColumn:row: \n for calculating column > width"); > return; > } > > lastColumn = [curColumns count]; > > // process one or all columns (or none) > if ( cn >= 0 ) { > if ( cn > lastColumn -1 ) { > NSLog(@"columnNumber grater than number of columns -1"); > return; > } else { > firstColumn = cn; > lastColumn = firstColumn; > } > } else { > firstColumn = 0; > } > > cellToCellSpacing = [self intercellSpacing]; > for(i=firstColumn;i<lastColumn;i++) { > // headerCell > curColId = [curColumns objectAtIndex:i]; > dataCellsFont = [[curColId dataCell] font]; > if ( dataCellsFont == nil ) { > // dataCellsFont = nil if headerCell is not a text-type cell > // set column width to reasonable minimum > cellWidthFitsAll = 10; > } else { > cellsSize = [[curColId headerCell] cellSize]; > cellWidthFitsAll = cellsSize.width; > } > > // dataCell for all rows > dataCellsFont = [[curColId dataCell] font]; > if ( dataCellsFont == nil ) { > // dataCellsFont = nil if dataCell is not a text-type cell > // leave column width as it is > } else { > attributes = [NSDictionary dictionaryWithObject:NSFontAttributeName > forKey:[dataCellsFont fontName]]; > formatter = [[curColId dataCell] formatter]; > for(j=0;r>j && j<[self numberOfRows];j++) { > if (formatter) > valueWithFormat = [formatter > stringForObjectValue:[datSo tableView:self > objectValueForTableColumn:curColId row:j]]; > else valueWithFormat = [datSo tableView:self > objectValueForTableColumn:curColId row:j]; > /* PSQLQuery's tableView:objectValueForTableColumn:row: returns an > NSCFString */ > cellsSize =[valueWithFormat sizeWithAttributes:attributes]; > } > if ( cellsSize.width > cellWidthFitsAll ) { > cellWidthFitsAll = cellsSize.width; > } > } > > // set column width > [curColId setWidth: > ((cellWidthFitsAll+cellToCellSpacing.width+0)*1.2)]; > /* added 0 for a border. corrected with factor 1.2 for an > undefined fault */ > } > [self setNeedsDisplay:YES]; > } > @end > > > > _______________________________________________________________ > > Don't miss the 2002 Sprint PCS Application Developer's Conference > August 25-28 in Las Vegas - > http://devcon.sprintpcs.com/adp/index.cfm?source=osdntextlink > > _______________________________________________ > Cocoapsql-developer mailing list > Coc...@li... > https://lists.sourceforge.net/lists/listinfo/cocoapsql-developer |
From: Olaf v. O. <ol...@ad...> - 2002-06-08 18:23:26
|
Moved the autoSizeColums from PSQLController.m to a new Catergory PSQLTableViewCat so the method will be available to all NSTableView's. Modified the method to be prepaired for the use of a formatter on NSTableColumn's dataCell (not tested!). Further the method name is altered and can point to one column or all (-1). The maximum number of rows to be processed is part of the method name as well. "PSQLTableViewCat" Grouped these files and the PSQLTextView files to the new Group "ClassExtensions" in the project. Added the choice to autosize one or all columns. Added to PSQLController.m #import "PSQLTableViewCat.h" Modified PSQLController submitQuery and setTableShouldAutoSizeColums: [self autoSizeTableColumns]; now is [tableView autoSizePSQLTableColumn:-1 maxRows:200]; PSQLTableViewCat.h #import <AppKit/NSTableView.h> @interface NSTableView ( PSQLTableView ) - (void)autoSizePSQLTableColumn:(int)cn maxRows:(int)r; @end PSQLTableViewCat.m #import "PSQLTableViewCat.h" #import <Cocoa/Cocoa.h> @implementation NSTableView ( PSQLTableView ) - (void)autoSizePSQLTableColumn:(int)cn maxRows:(int)r { NSFont *dataCellsFont; NSDictionary *attributes; NSSize cellToCellSpacing, cellsSize; float cellWidthFitsAll; int i, j, firstColumn, lastColumn; NSArray *curColumns = [self tableColumns]; id curColId; id datSo = [self dataSource]; id formatter; NSString *valueWithFormat; // need access to dataSource's method tableView:objectValueForTableColumn:row: SEL targetMethod = @selector(tableView:objectValueForTableColumn:row:); if ( ![datSo respondsToSelector:targetMethod] ) { NSLog(@"PSQLTableViewCat: need tableView:objectValueForTableColumn:row: \n for calculating column width"); return; } lastColumn = [curColumns count]; // process one or all columns (or none) if ( cn >= 0 ) { if ( cn > lastColumn -1 ) { NSLog(@"columnNumber grater than number of columns -1"); return; } else { firstColumn = cn; lastColumn = firstColumn; } } else { firstColumn = 0; } cellToCellSpacing = [self intercellSpacing]; for(i=firstColumn;i<lastColumn;i++) { // headerCell curColId = [curColumns objectAtIndex:i]; dataCellsFont = [[curColId dataCell] font]; if ( dataCellsFont == nil ) { // dataCellsFont = nil if headerCell is not a text-type cell // set column width to reasonable minimum cellWidthFitsAll = 10; } else { cellsSize = [[curColId headerCell] cellSize]; cellWidthFitsAll = cellsSize.width; } // dataCell for all rows dataCellsFont = [[curColId dataCell] font]; if ( dataCellsFont == nil ) { // dataCellsFont = nil if dataCell is not a text-type cell // leave column width as it is } else { attributes = [NSDictionary dictionaryWithObject:NSFontAttributeName forKey:[dataCellsFont fontName]]; formatter = [[curColId dataCell] formatter]; for(j=0;r>j && j<[self numberOfRows];j++) { if (formatter) valueWithFormat = [formatter stringForObjectValue:[datSo tableView:self objectValueForTableColumn:curColId row:j]]; else valueWithFormat = [datSo tableView:self objectValueForTableColumn:curColId row:j]; /* PSQLQuery's tableView:objectValueForTableColumn:row: returns an NSCFString */ cellsSize =[valueWithFormat sizeWithAttributes:attributes]; } if ( cellsSize.width > cellWidthFitsAll ) { cellWidthFitsAll = cellsSize.width; } } // set column width [curColId setWidth: ((cellWidthFitsAll+cellToCellSpacing.width+0)*1.2)]; /* added 0 for a border. corrected with factor 1.2 for an undefined fault */ } [self setNeedsDisplay:YES]; } @end |
From: Al K. <al...@ki...> - 2002-06-08 04:18:25
|
Please see the CVS Log. My battery is dying and I can't type much longer. See ya, Al |
From: Al K. <al...@ki...> - 2002-06-07 01:37:08
|
I have marked the relevant objects files as binary in the repository. See ya, Al |
From: Olaf v. O. <ol...@ad...> - 2002-06-05 21:05:26
|
June 5, 2002 - added Edit and Windows menu to the MainMenu.nib => MainMenu.nib: To have the validateMenuItems working (again) I had to find out that it's important now to check the Auto Enables Items in the menu's inspector. => PSQLController: added to the end of the lines 'replacing the queryScrollView's NSTextView' in awakeFromNib [querySpace setAllowsUndo:YES]; Cut, Copy, Paste, Select All, Undo and Redo work fine now on the querySpace (NSTextView) The Windows menu Hides and Shows the window (identified by it's title) |
From: Olaf v. O. <ol...@ad...> - 2002-06-05 17:42:48
|
From: Ted P. <te...@sy...> - 2002-06-05 11:33:39
|
guys, Have you notice the terminal window 'running' PG. whenever I quit from Cocoa psql, I see: DEBUG: pq_recvbuf: unexpected EOF on client connection BTW, apps created in realbasic do the same thing. It seems that CPS is not releasing postgres gracefully.... I have seen conversations to this on the postgres-interfaces discussion boards. Ted |
From: Al K. <al...@ki...> - 2002-06-05 11:31:44
|
Hi Olaf. Everything looks good (checkbox is there). I just compiled the new version with your changes and it all looks nice. We should talk about how to change the file types for the nibs and project files to binary in cvs. I think that we are running the risk of corrupting our nibs if we don't modify them. I was thinking of removing the files from cvs using cvs remove and then re-adding them individually using cvs add -kb (?). I think the -kb options are correct, I have to refer to the docs. What are your thoughts on this? Also the .cvswrappers file stored locally should go. The sourceforge admin simply modified the 1.2 version of cvswrappers to remove the problem lines. Al On Tuesday, June 4, 2002, at 03:33 PM, Olaf van Oudenallen wrote: > Hi Al, > > I just comitted "added optional autoSizing of tableColumns" (from > within PB). Things look fine in the (webbrowsed) repository. > I just saw that the v1.2 of the cvswrappers is still in the CVSROOR. I > removed my local .cvswrappers again. Is this right? > > Please check that the MainMenu.nib is commited right (added a checkBox) > > See you, Olaf > > |
From: Olaf v. O. <ol...@ad...> - 2002-06-04 20:23:36
|
June 6, 2002 - added optional autoSizing of the tableColumns after execution of a query or when checkbox is checked on (again). To do: <> I set a maximum to the number of rows rpcessed to calculate field sizes because I am afraid that it locks the system (for a relatively long time) when there are many rows to process. Alternatives are a max number of cells to process, set in the prefferences PLUS a dialog with a prgress indicator and a cancel butoon. <> To calculate the collumnSize to accomodate the cells, we have to add extra space for intercell spacing and more... <> The cellToCellSpacing = [tableView intercellSpacing] is not enough. I had to add 6 more to make (usually) it just fit. <> Different columns with differend types of values show a different result. Specialy date columns are too tight. PSQLController.m added marked lines //if we have info returned populate the results area if([query hasResults]) { [self populateTable]; add if ( tableWillAutoSizeColumns ) { add [self autoSizeTableColumns]; add [tableView setNeedsDisplay:YES]; add } } IB MainMenu.nib window added a checkBox "Size Columns To Fit" PSQLController added outlet checkAutoSizeTableColumns with connection to the checkBox PSQLController added action setTableShouldAutoSizeColums: with connection from the checkBox => PSQLController.h added BOOL tableWillAutoSizeColumns; - (IBAction)setTableShouldAutoSizeColums:(id)sender; - (BOOL)tableShouldAutoSizeColums; - (void)autoSizeTableColumns; => PSQLController.m -(id)init added tableWillAutoSizeColumns = YES; => PSQLController.m added // Check Box "Size Columns To Fit" action - (IBAction)setTableShouldAutoSizeColums:(id)sender { tableWillAutoSizeColumns = [checkAutoSizeTableColumns state] == NSOnState; if (tableWillAutoSizeColumns) [self autoSizeTableColumns]; } - (BOOL)tableShouldAutoSizeColums { return tableWillAutoSizeColumns; } - (void)autoSizeTableColumns { NSFont *dataCellsFont; NSDictionary *attributes; NSSize cellToCellSpacing, cellsSize; float cellWidthFitsAll; int i, j; NSArray *curColumns = [tableView tableColumns]; cellToCellSpacing = [tableView intercellSpacing]; for(i=0;200>i<[curColumns count];i++){ // process 200 rows max if ( dataCellsFont == nil ) { // dataCellsFont = nil if dataCell is not a text-type cell } else { dataCellsFont = [[[curColumns objectAtIndex:i] dataCell] font]; attributes = [NSDictionary dictionaryWithObject:NSFontAttributeName forKey:[dataCellsFont fontName]]; cellsSize = [[[curColumns objectAtIndex:i] headerCell] cellSize]; cellWidthFitsAll = cellsSize.width; /* ... dataCell] cellSize] recalculates size based on cell with value in last row: cellsSize = [[[curColumns objectAtIndex:2] dataCell] cellSize]; Also scanning all rows does not result in a "max-width": so FOR... */ for(j=0;j<[query rowCount];j++){ cellsSize =[[query valueAtRow:j Column:i] sizeWithAttributes:attributes]; if ( cellsSize.width > cellWidthFitsAll ) cellWidthFitsAll = cellsSize.width; } [[curColumns objectAtIndex:i] setWidth: cellWidthFitsAll+cellToCellSpacing.width+6]; // added 6 for a border } } /* or refer to a column with NSTableView's -(NSTableColumn)tableColumnWithIdentifier:(id)anObject */ } => PSQLController.m -(void)awakeFromNib added (to the end) [checkAutoSizeTableColumns setState:NSOnState]; // to make shure the UI reflects the variable's value To have it work the first time a query gets executed I had to set tableViw's dataSource to an empty dataSource on executing Connect for the first time: => PSQLController.h added - (void)setQueryToEmptyDataSource:(id)con; => PSQLController.m added -(void)setQueryToEmptyDataSource:(id)con { [query release]; query=[[PSQLQuery alloc]initWithEmptyData:con]; //query has a retain count of 1 if (query) { [tableView setDataSource:query]; [tableView reloadData]; } } => PSQLController.m added to -(void) doConnect after if([connection connect]) just before } else { if (![tableView dataSource]) { /* get an empty dataSource for the tableView to have the autoColumnWidht set correctly on executing the first query */ [self setQueryToEmptyDataSource:connection]; } => PSQLQuery.h added -(id)initWithEmptyData:(PSQLConnection *)con; => PSQLQuery.m added -(id)initWithEmptyData:(PSQLConnection *)con { if(self=[self init]) { //PGresult* PQmakeEmptyPGresult(PGconn *conn, ExecStatusType status); ExecStatusType pgStatus = PGRES_EMPTY_QUERY; result=PQmakeEmptyPGresult([con conn],pgStatus); if(!result){ querySuccessful = NO; hasResults=NO; } } return self; } |
From: Al K. <al...@ki...> - 2002-06-04 12:40:12
|
Hi all. CVS is working again. The sourceforge admins repaired the problem. We can all go back to work now. Sorry for the trouble. Al |
From: Al K. <al...@ki...> - 2002-06-02 03:24:45
|
Well. I have broken CVS for our project. I was working with the cvswrappers file and I included some commands which cvs does not like. I can't even revert it!!! CVS will no longer checkout, commit, or anything else. I am filing a support request with sourceforge as my searching of the documentation has been of little use. I appologize for the trouble. We will surely get it repaired quickly! (I Hope) Al |
From: Al K. <al...@ki...> - 2002-06-02 01:56:36
|
Hi Olaf. I think that I have corrected the problems with the ConnPrefs.nib file. See if it works if you pull a new snapshot from CVS. It seems to be working for me. Let me know, Al On Saturday, June 1, 2002, at 04:19 PM, Olaf van Oudenallen wrote: > I used PB to locallise ConnPrefs.nib (again). The Repository doesn't > show tha I moved the nib. Locally it's in my English.lproj folder now. > How does it look at other dev-computers? > > |
From: Al K. <al...@ki...> - 2002-06-02 01:46:47
|
Hi Olaf. I think that you need to do a "cvs add" on the nib file in the new location, specifically cocoapsql/English.lproj/ConnPrefs.nib. In your mind localizing the file simply moved it to a new location (I think since I don't know a lot about localization) but as far as cvs is concerned a new file was created in the English.lproj directory. That file does not exist in cvs yet. You have to add it and then commit it. I think that the localization will then be successful. Right now when I pull the current code from cvs the localization appears to be successful but the ConnPrefs.nib file mentioned above does not exist. The project will not compile. Maybe that helps. Al On Saturday, June 1, 2002, at 04:19 PM, Olaf van Oudenallen wrote: > I used PB to locallise ConnPrefs.nib (again). The Repository doesn't > show tha I moved the nib. Locally it's in my English.lproj folder now. > How does it look at other dev-computers? > > |
From: Olaf v. O. <ol...@ad...> - 2002-06-01 21:37:42
|
Hi Al, I looked a little at what does. I don't know exactly but basically some preferences are set and the app returns the saved password from the keychain. I am happy so far. See you, Olaf June 1, 2002 SSHPassKey.app v1.1 by Bill Bumgarner <bb...@co...> (http://www.versiontracker.com/moreinfo.fcgi?id=13221&db=mac) Stored the app in my Developer/Applications folder Using SSHPassKey With ProjectBuilder In the ~/Library/Preferences/com.apple.ProjectBuilder.plist the app added SSHPassKeyAppEnabled YES SSHPassKeyAppPath /Developer/Applications/SSHPassKey.app SSHPassKeyForceCVSToUseSSH YES PBXExtraPlugInFolders /Developer/Applications/SSHPassKey.app/Contents/Resources/Project Builder Plug-ins Using SSHPassKey Universally In the ~/.MacOSX/environment.plist the app added CVS_RSH ssh DISPLAY localhost SSH_ASKPASS /Developer/Applications/SSHPassKey.app/Contents/MacOS/SSHPassKey |
From: Olaf v. O. <ol...@ad...> - 2002-06-01 21:18:43
|
I used PB to locallise ConnPrefs.nib (again). The Repository doesn't show tha I moved the nib. Locally it's in my English.lproj folder now. How does it look at other dev-computers? |
From: Olaf v. O. <ol...@ad...> - 2002-06-01 15:02:42
|
Hi, This util helped my PB to CVS (correctly?) Have not yet figured out how and why exactly. Good luck. |
From: Olaf v. O. <ol...@ad...> - 2002-06-01 15:00:36
|
Please read when you have nothing else to do: copy of = http://developer.apple.com/techpubs/macosx/DeveloperTools/ProjectBuilder/P= rojectBuilder. help/Contents/Resources/English.lproj/SCM/Storing_Nib_ile_Bundles.html Storing Nib Files and Other File Bundles Many files in a project are bundles, which are directories that are=20 treated as a single file. Examples include Interface Builder's .nib=20 files and TextEdit's .rtfd files. By default, CVS manages each file in=20= the package individually. So if you wanted to check out a nib file, say,=20= you would need to check out each file in the nib file bundle=20 individually. You can set up CVS to treat a file package as a wrapper.=20= CVS converts a wrapper to a tar archive when it checks the wrapper in=20 and un-tars the wrapper when it checks the wrapper out. CVS manages the=20= tar archive in the repository, instead of individual files in the=20 package. To set up CVS to handle file packages as wrappers: * The CVS administrator must add and commit a cvswrappers file to = the=20 repository's top-level CVSROOT directory. * If you're using client/server CVS, all users must place that=20 cvswrappers file at the top level of their home directories. Tip: A sample cvswrappers file is in /Developer/Tools. You can rename=20 cvswrappers to .cvswappers so it's hidden in file listings. ------------------------------------------------------------------------ =A9 2002 Apple Computer, Inc. (Last Updated March 21, 2002) But the discussion on mamasam=20 (http://cocoa.mamasam.com/MACOSXDEV/2001/06/2/8522.php) of june 2001=20 (topic =3D CVS & .nibs) I understand that "taring" is not the solution. An other comment: My setup is as follows: CVS repository located on a FreeBSD box (remotehost) CVS 1.11 (client/server) CVSROOT/cvswrappers has nothing but binary entries. =A0The only addition I've made is a binary entry for objects.nib. Mac OS X 10.0.4 (localhost) CVS 1.10 'halibut' (client/server) CVS_RSH=3Dssh CVSROOT=3D:ext:<EMAIL REMOVED>:/path/to/repository I use ssh-agent/ssh-add so that I don't have to enter my password on=20 every CVS command I open Project Builder for the command line ('open my.pbproj') so that = it gets the environment variables needed by ssh and CVS. I've had no problems working on WebObjects and Cocoa projects with this setup. =A0I didn't do anything special for eomodels. =A0The nice thing = about _not_ using tar-wrappers for things like eomodels is that you can cvs=20 diff the individual plist for an entity. I've also used CVS 1.11 to checkout/update but can't say I've ever used=20= it for an emodel/nib because I usually only use CVS 1.11 (on the FreeBSD=20 box) =A0=A0for things like documentation. =A0However, I don't think there'd = be any problem there. Works for me :) hope that helps, -- Ian P. Cardenas Computer Scientist, Software ------------------------------------------------------------------------ http://cocoa.mamasam.com/MACOSXDEV/2001/06/2/8527.php FROM: Bill Bumgarner DATE: 2001-06-26 16:37 [Taking the liberty of cross posting because this'll probably be useful to a number of folks on all three lists. =A0 Also, I wrote a hints/tips email regarding CVS a few months ago-- if you are dealing with CVS on a regular basis, I would suggest having a look for that message in the archive.] In versions of EOModeler prior to that shipped with WebObjects 4.5 (4.0?), you need the EOModeler bundle from Omni that preserves the CVS directory information in a fashion similar to the Omni IB palette that is no longer needed with OSX. In any case, for both EOModels and NIB files, treat them as a normal directory. =A0 =A0As Ian suggested, add the wrapper information that = treats the objects.nib as a binary file, but treat everything else (save for images, if you happen to have 'em in the NIB file-- not recommended) as text. I.e. Say I created the project FooApp-- a Cocoa application using EOF/Java-- and I want to add it to my cvs repository. =A0The cvs repository's CVSROOT specification is "borg.codefab.com:/some/path/cvsroot/". The first thing I would do is ensure that there is a top level directory in CVS that contains the project and any other stuff. =A0 This ensures that you always have a single directory that you can check things out against and get everything in the repository related to your project. =A0 So, I start by building a directory structure something like: FooProject/ =A0=A0 =A0 =A0 =A0README.txt =A0=A0 =A0 =A0 =A0FooApp/ =A0=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0... project stuff here ... The next step is go into the FooApp directory and make sure that every file in the project is a file that you really want in the CVS repository. =A0CVS takes that attitude that once something has been = added to a repository, subsequent removal should be a fully audited event. =A0As= such, it can be a pain to remove files/directories after the initial import. =A0You are far better off ensuring that the hierarchy of stuff = to be imported into CVS is clean and has a structure that you plan on sticking with. =A0 The most painful CVS task is to restructure a project to reflect naming changes and hierarchy changes-- you are generally better of using 'cvs export' to export a copy of the source, then 'cvs import' to create a new repository. In any case, after cleaning, we use the following command to import the source: [localhost:~/FooProject] bbum% cvs -d localhost:/tmp/cvsroot import -m 'Importing base.' FooProject CODEFAB REL_000 <EMAIL REMOVED>'s password: U FooProject/README.txt cvs server: Importing /tmp/cvsroot/FooProject/FooApp N FooProject/FooApp/FooAppDelegate.java N FooProject/FooApp/main.m cvs server: Importing /tmp/cvsroot/FooProject/FooApp/English.lproj N FooProject/FooApp/English.lproj/InfoPlist.strings cvs server: Importing /tmp/cvsroot/FooProject/FooApp/English.lproj/MainMenu.nib ......... N FooProject/FooApp/German.lproj/MainMenu.nib/info.nib N FooProject/FooApp/German.lproj/MainMenu.nib/objects.nib cvs server: Importing /tmp/cvsroot/FooProject/FooApp/Japanese.lproj N FooProject/FooApp/Japanese.lproj/InfoPlist.strings cvs server: Importing /tmp/cvsroot/FooProject/FooApp/Japanese.lproj/MainMenu.nib N FooProject/FooApp/Japanese.lproj/MainMenu.nib/classes.nib N FooProject/FooApp/Japanese.lproj/MainMenu.nib/info.nib N FooProject/FooApp/Japanese.lproj/MainMenu.nib/objects.nib No conflicts created by this import VERY IMPORTANT: =A0 At this point, you want to verify that things have been correctly added to the repository and then *delete the tree of stuff that you imported*. =A0Yes, delete it. =A0This will prevent you = from continuing development in that tree of stuff. =A0 =A0A cvs import does = not make the tree you are importing into a cvs controlled workarea-- if you DO continue working in it while other developers have checked out copies of the repository in the normal fashion and have committed changes, you will be facing a nasty integration issue. =A0So: [localhost:~] bbum% cd ~/Developer cvs -d localhost:/tmp/cvsroot checkout FooProject cvs server: Updating FooProject U FooProject/README.txt cvs server: Updating FooProject/FooApp U FooProject/FooApp/FooAppDelegate.java U FooProject/FooApp/main.m .............. U FooProject/FooApp/Japanese.lproj/MainMenu.nib/classes.nib U FooProject/FooApp/Japanese.lproj/MainMenu.nib/info.nib U FooProject/FooApp/Japanese.lproj/MainMenu.nib/objects.nib [localhost:~/Developer] bbum% diff -x CVS -r ~/FooProject FooProject [localhost:~/Developer] bbum% Good-- no differences between the imported tree and the tree checked out from the workarea. =A0 (omit the -x CVS and you will see that there are differences; =A0the second tree has the all important CVS administrative directories). Now that it has been imported, we should assert that the appropriate administrative flags have been set on files that should be handled as binary: [localhost:~/Developer] bbum% cd FooProject/FooApp/French.lproj/MainMenu.nib/ [localhost:FooApp/French.lproj/MainMenu.nib] bbum% cvs status -v objects.nib =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D File: objects.nib =A0 =A0 =A0 Status: Up-to-date =A0=A0 =A0Working revision: =A0 =A01.1.1.1 =A0=A0 =A0Repository revision: 1.1.1.1 /tmp/cvsroot/FooProject/FooApp/French.lproj/MainMenu.nib/objects.nib,v =A0=A0 =A0Sticky Tag: =A0 =A0 =A0 =A0 =A0(none) =A0=A0 =A0Sticky Date: =A0 =A0 =A0 =A0 (none) =A0=A0 =A0Sticky Options: =A0 =A0 =A0-kb =A0=A0 =A0Existing Tags: =A0=A0 =A0 =A0 =A0 REL_000 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= (revision: 1.1.1.1) =A0=A0 =A0 =A0 =A0 CODEFAB =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= (branch: 1.1.1) The Sticky Options indicate that the file is being handled as a binary file. =A0 The working version and branching information is fallout from doing a cvs import. =A0 As soon as you commit any file, the working revision of that file will become "1.2" (etc). =A0 This may seem odd, = but can actually be quite helpful when tracking and modifying third part sources. =A0 It means that you can always switch to the branch of code containing exactly what was shipped to you, can then apply patches, and subsequently use 'cvs update' to apply the patches on the branch to the main trunk of development. If the objects.nib did NOT have the -kb flag because you forgot to modify the cvswrappers file then, you would need to: [localhost:FooApp/German.lproj/MainMenu.nib] bbum% cvs admin -kb objects.nib This will add the binary flag. =A0However, you *must* verify that the = file hasn't been corrupted by cvs keyword expansion!!!! =A0If it has been, = you will need to: [localhost:FooApp/German.lproj/MainMenu.nib] cp ~/FooProject/FooApp/German.lproj/MainMenu.nib/objects.nib objects.nib [localhost:FooApp/German.lproj/MainMenu.nib] bbum% cvs commit -m 'Fixed objects.nib because keyword expansion blew it up. =A0Copied original.' cvs commit: Examining . Checking in objects.nib; /tmp/cvsroot/FooProject/FooApp/German.lproj/MainMenu.nib/objects.nib,v=20= =A0<-- =A0 objects.nib new revision: 1.2; previous revision: 1.1 done Note: =A0If keyword expansion HAD actually blown up any of the files in your project, the diff command shown above would have identified the files that had been modified. Note2: =A0CVS keyword expansion basically substitutes various bits of information for things like $Id$ and $Log$. =A0While they sound useful, they really aren't. =A0 In particular, they pretty much guarantee that = any two revisions of a file will have differences. =A0In particular, the = $Log$ ensures that you will run into a constant stream of conflicts when updating your workarea. =A0There are far better ways of dealing with = this information. Build the project and make sure it does what you expect. Now that we have verified that the project works as checked out from the repository-- that it is identical to our originally imported source-- go ahead and remove the originally imported tree of goo to prevent making the mistake of doing any kind of development work on it. =A0At this = point, the cvs repository is your master copy. =A0We basically ensure the cvs repository is backed up in at least 2 locations-- one via rsync to another host (a hot nightly backup) and one to tape. =A0 We treat workareas as totally throwaway; =A0they are not backed up and the developer is encouraged to make sure they check in working code early and often. =A0This minimizes integration issues and, combined with = testing suites, ensures that the software continues to work as a system and not just as individual pieces. [localhost:~/Developer] bbum% rm -rf ~/FooProject That'll keep me from wasting more of my life doing unnecessary code integrations.... :-) As you work with the project, always use 'cvs -q update -dP' to update your workarea. =A0Do this often; =A0more often then needed to simply = pull changes from the repository. =A0 Not only will this reduce integration issues, it also gives you an inventory of every file in your workarea that isn't controlled by CVS. =A0For example: [localhost:~/Developer/FooProject/FooApp] bbum% cvs -q update -dP ? MyDocument.java ? German.lproj/MyDocument.nib This indicates that I have a nib file and a java file in my workarea that are not in CVS. =A0 To add: [localhost:~/Developer/FooProject/FooApp] bbum% cvs add MyDocument.java German.lproj/MyDocument.nib ? German.lproj/MyDocument.nib/classes.nib ? German.lproj/MyDocument.nib/info.nib ? German.lproj/MyDocument.nib/objects.nib cvs server: scheduling file `MyDocument.java' for addition Directory /tmp/cvsroot/FooProject/FooApp/German.lproj/MyDocument.nib added to the repository cvs server: use 'cvs commit' to add this file permanently OK-- I added the .niib directory, and now CVS is telling me the contents of that directory are not under CVS control. =A0Need to add those, as = well: [localhost:~/Developer/FooProject/FooApp] bbum% cvs add German.lproj/MyDocument.nib/*.nib cvs server: scheduling file `German.lproj/MyDocument.nib/classes.nib' for addition cvs server: scheduling file `German.lproj/MyDocument.nib/info.nib' for addition cvs server: scheduling file `German.lproj/MyDocument.nib/objects.nib' for addition cvs server: use 'cvs commit' to add these files permanently Finally, another cvs update to check the status on my workarea: [localhost:~/Developer/FooProject/FooApp] bbum% cvs -q update -dP <EMAIL REMOVED>'s password: A MyDocument.java A German.lproj/MyDocument.nib/classes.nib A German.lproj/MyDocument.nib/info.nib A German.lproj/MyDocument.nib/objects.nib Might as well check to make sure that the objects.nib will be handled as a binary file: [localhost:~/Developer/FooProject/FooApp] bbum% cvs status -v German.lproj/MyDocument.nib/objects.nib =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D File: objects.nib =A0 =A0 =A0 Status: Locally Added =A0=A0 =A0Working revision: =A0 =A0New file! =A0=A0 =A0Repository revision: No revision control file =A0=A0 =A0Sticky Tag: =A0 =A0 =A0 =A0 =A0(none) =A0=A0 =A0Sticky Date: =A0 =A0 =A0 =A0 (none) =A0=A0 =A0Sticky Options: =A0 =A0 =A0-kb Yup; =A0commit: [localhost:~/Developer/FooProject/FooApp] bbum% cvs -q commit -m 'Added MyDocument interface and implementation [interface in German only, for now].' RCS file: /tmp/cvsroot/FooProject/FooApp/MyDocument.java,v done Checking in MyDocument.java; /tmp/cvsroot/FooProject/FooApp/MyDocument.java,v =A0<-- =A0MyDocument.java= initial revision: 1.1 done ...... Checking in German.lproj/MyDocument.nib/objects.nib; /tmp/cvsroot/FooProject/FooApp/German.lproj/MyDocument.nib/objects.nib,v = =A0 <-- =A0 objects.nib initial revision: 1.1 done See the other message for a bunch of hints/tips regarding "power" use of CVS. =A0 Some final tips: - if you cp -r a NIB file (or Save As.... from Interface Builder), =A0*** MAKE SURE *** you remove the CVS directory from the COPY. =A0DO NOT = SCREW THIS UP. =A0If you do screw it up, you are in for a bit of hell undoing the problem. =A0Notably, CVS really doesn't care about directories-- the copied CVS entries will cause the contents of the .nib to effectively overwrite the original version. =A0Thankfully, everything is revision controlled, so you should be able to recover the original versions. =A0But= straightening out your workarea and the repository is not fun. =A0 If I get a chance, I'll write up an email demonstrating exactly how much fun it isn't. - CVL.app is an excellent CVS GUI. =A0Check it out; =A0see SoftTrak at www.stepwise.com to find the latest version. =A0 Even with a good GUI, = it is a wise idea to understand what is going on under the covers. =A0CVL (and others) basically drive the command line cvs by stuffing various permutations of arguments and executing the command line binary via, say, NSTask. - Project Builder's SCM integration is almost very very cool. =A0 At = this point, I use it to view differences between my workarea and repository, but I use the command line to take care of all actual read/write operations. =A0 It will likely get better in future releases. good luck, b.bum --- * if we were really starting from scratch, I would do: bbum% cvs -t -d borg.codefab.com:/some/path/cvsroot/ init ... to initialize the repository. =A0I could then check out the CVSROOT directory.... [localhost:~] bbum% cvs -d borg.codefab.com:/some/path/cvsroot/ =A0 checkout CVSROOT cvs server: Updating CVSROOT U CVSROOT/checkoutlist U CVSROOT/commitinfo U CVSROOT/config U CVSROOT/cvswrappers ..... ...and add the objects.nib specification to cvswrappers... [localhost:~] bbum% cd CVSROOT [localhost:~/CVSROOT] bbum% tail cvswrappers # =A0-k =A0 =A0 =A0 =A0 =A0 expansion mode =A0 =A0 =A0 =A0 =A0value: b, = o, kkv, &c # # =A0and value is a single-quote delimited value. # For example: *.gif -k 'b' *.tiff -k 'b' *.jpeg -k 'b' *.icns -k 'b' objects.nib -k 'b' *.rsrc -k 'b' [localhost:~/CVSROOT] bbum% cvs commit -m 'Added an incomplete set of binary specs for Cocoa development.' cvs commit: Examining . Checking in cvswrappers; /some/path/cvsroot//CVSROOT/cvswrappers,v =A0<-- =A0cvswrappers new revision: 1.2; previous revision: 1.1 done cvs server: Rebuilding administrative file database You may also want to edit the cvsignore file and make sure it contains a reasonable set of files to ignore. =A0Keep in mind that the ignore behavior is different between add and import-- one of the wonderful little quirks of CVSs ultra inconsistent design and implementation. |