Sunday, 7 November 2010

How do I see if a branch contains a bug fix in Perforce?

Perforce tracks where revisions of a file have been integrated, but it doesn't automatically propagate check-in comments with your bug-tracking metadata.

Given a changelist on a particular branch, you can tell whether Perforce thinks the changelist has been integrated by asking Perforce to integrate the changelist. (I'm using "branch" in the more traditional source-control sense, to mean a particular branch of the source code tree, rather than in the specific Perforce sense to mean the path of integration between these two source code trees.) Let's say you've been working in //source/project/trunk/... and you have a changelist @1234 that you'd like to check whether it's been integrated into your release branch //source/project/rel/.... Create a client that maps //source/project/rel/... and execute:

$ p4 integrate -n //source/project/trunk/...@1234,1234 //source/project/rel/...

If Perforce tells you "All revision(s) already integrated.", changelist @1234 has been integrated, and that bugfix ought to be available on the release branch. If Perforce lists files that have changed, those files have not been integrated. (It's also possible for some files in a changelist to be integrated and not others, which may make for some interesting problems.)

This doesn't scale especially well -- you need to check each bugfix on each branch you care about, though it does lend itself to automation.

You can use the "unsupported" Perforce command interchanges to get a quick idea of what changelists have not been integrated from one branch into another. (In Perforce parlance, "unsupported" means something like "might not work the same in the next revision, but we think it could be useful so we'll release it anyway".) To see what changelists haven't been integrated from our example trunk to release branches, execute:

$ p4 interchanges //source/project/trunk/... //source/project/rel/...Change 1236 on 2010/10/10 by user@client 'Fixed some bug you don't care about'Change 1235 on 2010/10/09 by user@other_client 'Fixed some other random bug'

In this example, I haven't listed changelist @1234 because it's already been integrated into the release branch. One problem I've experienced using interchanges is it'll list every newer revision after an unintegrated change, even if the newer revisions themselves have been integrated, so if you're cherry-picking revisions for a release branch you may see changelists listed again. I use interchanges as a first pass to get a rough idea of what I need to integrate, then look at integrate to get a better idea of what's really missing.

(Perforce also supports a similar concept of "jobs", that let one attach particular fixes to particular changelists, but my organization doesn't use them so I don't know how well they work or whether they are propagated automatically on integration.)


View the original article here

Uninstalling the P4Eclipse Plug-In

How do I uninstall the P4Eclipse plug-in?

To uninstall P4Eclipse, follow the instructions for your version of Eclipse:

For more information on uninstalling P4Eclipse, please see the P4Eclipse Release Notes.

To uninstall P4Eclipse/P4WSAD from Eclipse 3.5:

Disconnect all projects in the IDE from Perforce (Team | Unmanage). Close the Perforce perspective by choosing Window | Open Perspective | Other... | Perforce
and, once the perspective is open, choose Window | Close Perspective. Choose Help | Install New Software...

The Available Software form is displayed.

Click on "What is already installed?"

The Eclipse SDK Installation Details window is displayed.

In the Installed Software tab, highlight P4WSAD, and click Uninstall.

The Uninstall Details window is displayed. Click Finish.

When prompted, click Yes to restart the IDE. In the IDE workspace (on the system where the IDE is used), recursively search the ".metadata/.plugins" directory for "perforce" and  remove any files or folders that are found.

This should include but is not limited to the following:

WORKSPACE/.metadata/.plugins/org.eclipse.core.runtime/.settings/*perforce*.prefsWORKSPACE/.metadata/.plugin/*perforce*/
Open the bundles.info file found in the following directory:

ECLIPSE_HOME/configuration/org.eclipse.equinox.simpleconfigurator

Search for "perforce" and verify that there are no occurrences. Restart Eclipse and verify that the Perforce perspective is no longer available from the
Window | Open Perspective | Other... dialog. To uninstall P4Eclipse/P4WSAD from Eclipse 3.4: Disconnect all projects in the IDE from Perforce (Team | Unmanage). Close the Perforce perspective by choosing Window | Open Perspective | Other... | Perforce
and, once the perspective is open, choose Window | Close Perspective. Choose Help | Software Updates...

The Software Updates dialog is displayed.

Click the Installed Software tab. Right-click the entry for the P4WSAD plugin and choose Uninstall....

Click Finish on the Uninstall dialog.

When prompted, click Yes to restart the IDE.

In the IDE workspace (on the system where the IDE is used), recursively search the ".metadata/.plugins" directory for "perforce" and  remove any files or folders that are found. This should include but is not limited to the following: WORKSPACE/.metadata/.plugins/org.eclipse.core.runtime/.settings/*perforce*.prefs WORKSPACE/.metadata/.plugin/*perforce*/
Open the bundles.info file found in the following directory:

ECLIPSE_HOME/configuration/org.eclipse.equinox.simpleconfigurator

Search for "perforce" and verify that there are no occurrences.

Restart Eclipse and verify that the Perforce perspective is no longer available from the
Window | Open Perspective | Other... dialog.

To uninstall P4WSAD from Eclipse 3.0 - 3.3 or Rational Application Developer 7:

Disconnect all projects in the IDE from Perforce (Team | Unmanage), and close the Perforce Perspective and any other Perforce views that are open. Choose Help | Software Updates | Manage Configuration.

The Manage Configuration dialog is displayed.

Open the entry for the installation, right-click the entry for the P4WSAD plug-in and choose Uninstall. When prompted "Do you want to disable and uninstall this feature?", click Yes. To uninstall other plugins that were replaced with the current one, click the Show Disabled Features button.

Right-click any P4WSAD entries and choose Uninstall.

Exit Eclipse.

In the ECLIPSE_HOME directory, search recursively for "perforce" and remove any files or folders that are found.

Note: the ECLIPSE_HOME directory is usually the Eclipse software directory.

In the IDE workspace (on the system where the IDE is used), recursively search the ".metadata/.plugins" directory for "perforce" and remove any files or folders that are found.

Restart Eclipse and verify that the Perforce perspective is no longer available.

View the original article here

How can I instruct Perforce to merge instead of overwrite or revert when unshelving a file?

How can I instruct Perforce to merge changes into an existing, open, and modified file in the workspace when unshelving a file shelved in the depot? The only options that Perforce appears to offer the user is to overwrite or revert the existing file in the workspace, but this does not allow, for example, to unshelve and integrate changes to the same file from multiple change lists. Is there a way around this limitation?


View the original article here

Zeroconf APIs

There does not appear to be any way to detect zeroconf-enabled Perforce servers with P4API.

At this time, P4API does not implement zeroconf detection of Perforce servers. However, that functionality is available through third-party packages and APIs.

The following is a list of such packages or APIs for various languages:

C:

http://developer.apple.com/documentation/networking/Reference/DNSService


Java:

http://developer.apple.com/documentation/Java/Reference/DNSServiceDiscov


Python:

http://o2s.csail.mit.edu/download/pybonjour/


Perl:

http://search.cpan.org/~chlige/Net-Bonjour-0.96/lib/Net/Bonjour.pm


Cocoa/Carbon:

http://developer.apple.com/documentation/Networking/Conceptual/NSNetServiceProgGuide/Introduction.html


Ruby:

http://rubyforge.org/projects/dnssd/


Linux C:

http://avahi.org/


Service Discovery Homepage: 

http://www.dns-sd.org/


View the original article here

Perforce : is there any better way to comment one line in client spec?

You can't.

The clientspec you see is just the output from the perforce database. It gets parsed when saved, so any comments would disappear the next time you load the clientspec.


View the original article here

Sequence error: local change vs remote

What does "Sequence error: local 'change' counter vs remote" mean? Why am I getting "Sequence error" when trying to submit a file to the server?


A "Sequence error" occurs when the change counter is altered before a submit of an existing pending numbered change.  Changelists should always appear in a sequential order, and this error means that the sequence is potentially out of order. If you see this error, contact Perforce Support immediately and shut down your Perforce Server.

Note: Carrying on with this error in place could cause further damage to the information stored in your Server.

The sequence of events that generates this error, is as follows:
Create a pending numbered changeForce the change counter to a number below the pending change numberAttempt to submit the pending numbered changeFrom the error reported, local refers to the current change counter value and remote the value of numbered pending change.  For example: p4 submit -c 221Submitting change 221.Locking 1 files ...edit //depot/main/jam.c#4Operation 'dm-CommitSubmit' failed.Sequence error: local 'change' counter '100' vs remote '221'!Here the change counter has been set to 100 whereas the pending numbered changelist created before the change counter was changed was change 221.

View the original article here

Is it possible to import all of the Perforce history into Kiln

First look here:

Mercurial Wiki entry for converting from Perforce

Since the conversion of VC systems with different paradigms is non trivial, you might want to tweak one of the methods considered there.

If this fails totally, you can also try to convert to a intermediate VC system like, SVN, CVS, git and then to mercurial.

Once you got it in mercurial locally you can always move it up to Kiln or one of the other hosted systems.


View the original article here