Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Perforce doesn't know that I have changes to submit

I'm new to Perforce. I'm much more comfortable with Git and some Subversion.

Anyway, this is what happened:

  1. I created a branch for myself in p4v located in location A on my machine.
  2. I created a Java project in location B, and copied it into location A on my computer.
  3. I created and submitted a changelist for the Java project.
  4. I realized that I needed to make another change, so I went back to Eclipse and edited the project. But, I forgot that the project in Eclipse is pointing to the one in location B.
  5. So, I copied the project from location B to location A, where the branch is.

But now I can't create a changelist for the edits because Perforce thinks that there are no changes to commit.

What did I do wrong, how do I fix it, and what are some Perforce best practices to avoid this craziness in the future?

like image 959
user5243421 Avatar asked Dec 27 '22 13:12

user5243421


2 Answers

There is an Eclipse plugin for Perforce. If you install this then you will be able work with the project in Eclipse at location A.

If you make an edit to any file or setting Perforce will check the file out automatically and place it in the default changelist.

You can then either check it back in from there or use P4V to manage your changelists.

As @jamesdlin points out Perforce effectively "owns" the files and you shouldn't make any edits without "asking permission" first by either an explicit p4 edit command or via the IDE plugin.

If you've made a change without first checking out the file you can simply make the p4 edit call. This doesn't overwrite the local file, just marks the file as writeable as far as Perforce is concerned. Perforce should then recognise that there's an edit pending and let you check it in.

like image 120
ChrisF Avatar answered Jan 05 '23 11:01

ChrisF


You need to do p4 edit on the files before you edit them. Normally files are marked as read-only to strongly discourage you from modifying the files without first marking them for edit.

The best practice would be not to fight the read-only permissions.

like image 41
jamesdlin Avatar answered Jan 05 '23 11:01

jamesdlin