Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » importing a project in eclipse(Importing a project in eclipse)
importing a project in eclipse [message #660349] Fri, 18 March 2011 04:33 Go to next message
Mahesh Tummala is currently offline Mahesh TummalaFriend
Messages: 1
Registered: March 2011
Junior Member
I am using perforce version control in my company. I have sync some projects from repository. I opened eclipse and i imported an existing project through: file->import->existing projects into workspace->selected the root folder->finish.
The project came to the project explorer of eclipse. But when i try to access the web.xml file in that project it is opening as a read-only file. I am unable to edit that file. But i need to edit that file. Please give suggestions on this as early as possible.
Re: importing a project in eclipse [message #660351 is a reply to message #660349] Fri, 18 March 2011 04:40 Go to previous messageGo to next message
Animesh Kumar is currently offline Animesh KumarFriend
Messages: 79
Registered: September 2010
Location: Bangalore
Member
Whenever you are importing something which was synced using perforce, it usually gets it in read only formal only. You must be allowed to change the properties of the file. Just try un-checking the Read-Only option from Properties. You will be able to Edit after that. I hope that should work

Regards,
Animesh

[Updated on: Fri, 18 March 2011 04:41]

Report message to a moderator

Re: importing a project in eclipse [message #660436 is a reply to message #660349] Fri, 18 March 2011 12:40 Go to previous messageGo to next message
Russell Bateman is currently offline Russell BatemanFriend
Messages: 3798
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

On 2011.03.17 22:33, Mahesh Tummala wrote:
> I am using perforce version control in my company. I have sync some
> projects from repository. I opened eclipse and i imported an existing
> project through: file->import->existing projects into
> workspace->selected the root folder->finish.
> The project came to the project explorer of eclipse. But when i try to
> access the web.xml file in that project it is opening as a read-only
> file. I am unable to edit that file. But i need to edit that file.
> Please give suggestions on this as early as possible.

I'm new to Perforce. I don't yet know of any Perforce integration (such
as exists for CVS, Subversion and now Git). Do you not have to signal to
Perforce that you intend to edit the file? I too am interested as I'm
beginning only to work on new software using Perforce, but have not yet
begun to make changes at this point.
Re: importing a project in eclipse [message #660659 is a reply to message #660349] Sun, 20 March 2011 19:11 Go to previous messageGo to next message
Dilton McGowan II is currently offline Dilton McGowan IIFriend
Messages: 110
Registered: July 2009
Senior Member
On Fri, 18 Mar 2011 00:33:54 -0400, Mahesh Tummala wrote:

> I am using perforce version control in my company. I have sync some
> projects from repository. I opened eclipse and i imported an existing
> project through: file->import->existing projects into
> workspace->selected the root folder->finish. The project came to the
> project explorer of eclipse. But when i try to access the web.xml file
> in that project it is opening as a read-only file. I am unable to edit
> that file. But i need to edit that file. Please give suggestions on this
> as early as possible.

Google says there's a Perforce Eclipse plug-in are you using that
or managing the files outside of Eclipse?

When you imported did you notice of "Copy Projects into Workspace" was
checked? If it was then the project may not be connected to Perforce.
Re: importing a project in eclipse [message #660669 is a reply to message #660659] Sun, 20 March 2011 22:45 Go to previous messageGo to next message
Russell Bateman is currently offline Russell BatemanFriend
Messages: 3798
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

On 2011.03.20 13:11, Dilton wrote:
> On Fri, 18 Mar 2011 00:33:54 -0400, Mahesh Tummala wrote:
>
>> I am using perforce version control in my company. I have sync some
>> projects from repository. I opened eclipse and i imported an existing
>> project through: file->import->existing projects into
>> workspace->selected the root folder->finish. The project came to the
>> project explorer of eclipse. But when i try to access the web.xml file
>> in that project it is opening as a read-only file. I am unable to edit
>> that file. But i need to edit that file. Please give suggestions on this
>> as early as possible.
>
> Google says there's a Perforce Eclipse plug-in are you using that
> or managing the files outside of Eclipse?
>
> When you imported did you notice of "Copy Projects into Workspace" was
> checked? If it was then the project may not be connected to Perforce.
>

I'm not using that plug-in yet. I'm actually holding out hope we'll move
from Perforce to Git before the project gets too much underway.

I did not copy my project into my workspace because a) I wouldn't
typically do that when dealing with source code under version control
anyway (I have a long history of Subversion use) and b) for the reason
you point out.

Thanks.
Re: importing a project in eclipse [message #660676 is a reply to message #660669] Mon, 21 March 2011 03:02 Go to previous messageGo to next message
Animesh Kumar is currently offline Animesh KumarFriend
Messages: 79
Registered: September 2010
Location: Bangalore
Member
Hi All,
We have been using perforce since a long time.

If you are using an Eclipse Plugin for perforce, you can get your projects from perforce repository in three ways:-
1) Go the the Perforce Perspective and in the P4 connections view, you can go to the project and select either "Get Latest Revision" or "Get Revision" , whichever suits you.
In this case, the project is imported to your perforce workspace and hence when you would have to again import the project to your desired workspace in the IDE, it will be in a read-only format.
I guess this is what Mahesh had actually done.

Or you might have, synced the Project from outside Eclipse and then tried to Import it into your Eclipse Workspace. In this case, it will be read-only formal only.

2) Another way is, in the P4 connections view, selecting the project and choosing "Import as Project" or "Import as Project with Name...". In this case the project will go to your perforce workspace and will also be visible in your Package Explorer view in the IDE. The project gets imported to the workspace associated with the IDE (but it won't get copied there, the project will still reside in perforce workspace.).

In this case also, the projects imported are "Read-Only".

You should also remember that the workspace you are using in your IDE may be totally different from the Perforce Workspace.

3) Another way is, that when you are importing the projects, instead of selecting General-> Existing Projects into Workspace, you can select Perforce->Projects from Perforce. But, in this case also, the imported project will be in Read-Only format only.

The only reason that, i have mentioned all the three ways is, because, in the first way, when you import the project into Eclipse workspace from the perforce Workspace, Eclipse would not know that the project had come from Perforce.
So, if you want to make changes in the files, you will have to tell Eclipse that they have been synced from Perforce. For this, you will have to go to , Team -> Share Project -> Choose Perforce.
You must remember one thing when you are doing this, the project must be located in the Perforce Workspace and not in you Eclipse workspace, otherwise you will face some problems in Sharing the Project or in later stages.
When Once Shared, you can make changes to the files. It will automatically "Check Out" those files which you are changing and you will be able to see some difference in the package explorer for the changed files.

Whereas in the second and third way, it gets directly synchronised with the Perforce Repository.
So if you want to change something, you can do it as above. (Or you can go to Team -> Check Out. And then start making changes. This is optional because if the project is in sync with perforce, then it automatically checks the file out, when you start making any changes.)Thats how you can make changes, in perforce files.

If you want to make local changes, then you can change the property of the files and uncheck Read-Only.




Regards,
Animesh

[Updated on: Mon, 21 March 2011 04:33]

Report message to a moderator

Re: importing a project in eclipse [message #660742 is a reply to message #660676] Mon, 21 March 2011 12:42 Go to previous messageGo to next message
Russell Bateman is currently offline Russell BatemanFriend
Messages: 3798
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

On 2011.03.20 21:03, Animesh Kumar wrote:
> Hi All,
> We have been using perforce since a long time. If you are using an
> Eclipse Plugin for perforce, you can get your projects from perforce
> repository in two ways:-
> 1) Go the the Perforce Perspective and in the P4 connections view, you
> can go to the project and select either "Get Latest Revision" or "Get
> Revision" , whichever suits you.
> In this case, the project is imported to your perforce workspace and
> hence when you would have to again import the project to your desired
> workspace in the IDE, it will be in a read-only format.
> I guess this is what Mahesh had actually done.
>
> 2) Another way is, in the P4 connections view, selecting the project and
> choosing "Import as Project" or "Import as Project with Name...". In
> this case the project will go to your perforce workspace and will also
> be visible in your Package Explorer view in the IDE. The project gets
> imported to the workspace associated with the IDE (but it won't get
> copied there, the project will still reside in perforce workspace.).
>
> In this case, the projects imported are "Not Read-Only". So if you don't
> want read-only formats, then you can prefer this way or else, the first
> one.
>
> You should also remember that the workspace you are using in your IDE
> may be totally different from the Perforce Workspace.

Yes, we noted the distinction in terminology for workspace between
Perforce and Eclipse.

Thanks, Animesh, you've been very helpful!
Re: importing a project in eclipse [message #661210 is a reply to message #660349] Wed, 23 March 2011 15:18 Go to previous messageGo to next message
Eric Rizzo is currently offline Eric RizzoFriend
Messages: 3070
Registered: July 2009
Senior Member
On 3/18/11 12:33 AM, Mahesh Tummala wrote:
> I am using perforce version control in my company. I have sync some
> projects from repository. I opened eclipse and i imported an existing
> project through: file->import->existing projects into
> workspace->selected the root folder->finish.
> The project came to the project explorer of eclipse. But when i try to
> access the web.xml file in that project it is opening as a read-only
> file. I am unable to edit that file. But i need to edit that file.
> Please give suggestions on this as early as possible.

I recommend you use the Perforce plugin for Eclipse instead of just
importing projects from your Perforce "workspace" into Eclipse.
http://www.perforce.com/perforce/products/p4eclipse.html

Eric
Re: importing a project in eclipse [message #674827 is a reply to message #661210] Sat, 28 May 2011 18:54 Go to previous messageGo to next message
DevByStarlight  is currently offline DevByStarlight Friend
Messages: 4
Registered: May 2011
Junior Member
Animesh mentions it above.

But here is the "secret"

Team -> Share Project -> Choose perforce.

Right click on your project and, towards the bottom of the menu, click Team -> Share Project.

Eclipse will then connect to Perforce and update the status of the source files (presuming you setup the Perforce client/depot correctly).
You will know if it works because the little file icons will update to indicate status (checked in, etc).
Also, if you start typing in a file, Eclipse will automatically check out the file.


It sounds silly but *nowhere* in the Eclipse Perforce plugin help file is this mentioned.
It sounds sillier but *nowhere* in the Perforce website's "how to" is this mentioned.


Particularly if you're coming from a MSVC dev environment, the above "Team->Share Project" is somewhat equivalent to MSVC's Right Click -> Source Control.
Re: importing a project in eclipse [message #675439 is a reply to message #660436] Tue, 31 May 2011 14:06 Go to previous messageGo to next message
Russell Bateman is currently offline Russell BatemanFriend
Messages: 3798
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

On 18-Mar-11 06:40, Russell Bateman wrote:
> On 2011.03.17 22:33, Mahesh Tummala wrote:
>> I am using perforce version control in my company. I have sync some
>> projects from repository. I opened eclipse and i imported an existing
>> project through: file->import->existing projects into
>> workspace->selected the root folder->finish.
>> The project came to the project explorer of eclipse. But when i try to
>> access the web.xml file in that project it is opening as a read-only
>> file. I am unable to edit that file. But i need to edit that file.
>> Please give suggestions on this as early as possible.
>
> I'm new to Perforce. I don't yet know of any Perforce integration (such
> as exists for CVS, Subversion and now Git). Do you not have to signal to
> Perforce that you intend to edit the file? I too am interested as I'm
> beginning only to work on new software using Perforce, but have not yet
> begun to make changes at this point.

I'm no longer new to Perforce and, while I think there's some good
advice elsewhere in this thread, I rejected Eclipse-Perforce integration
early on as it dramatically slowed my ability to launch and to switch
workspaces (probably because it requires Mylyn). Instead, I continue to
use the p4 command line. I tend to be a command-line sort of guy anyway,
so this may be my fault for so quickly abandoning the GUI solutions (I
am only tempted to use p4v for diff/merge operations).

<rant>
Last, a totally unproductive comment!

My team is so sick of the nightmare that Perforce is that we use Git on
our own new development and as soon as we can rid ourselves of the
obligation to continue working in our employer's greater codebase, it
will be sayonara forever to this hulking, expensive piece of yesteryear.

Why companies want to pay for software that works no better or often
worse than the open source equivalents (svn, Git, Bugzilla, Vim,
Eclipse, OpenOffice, etc.) is quite beyond me.

(Forgive me: I think this is the first time I've unleashed a shameless
rant in this forum.)
</rant>
Re: importing a project in eclipse [message #824031 is a reply to message #675439] Mon, 19 March 2012 07:00 Go to previous message
Girish Padharthi is currently offline Girish PadharthiFriend
Messages: 1
Registered: March 2012
Junior Member
Hi,

I've had some trouble while importing projects with P4Eclipse. As far as i've searched, this is the most relevant thread that deals with importing projects.

I'm using Eclipse Helios with CDT and have recently integrated the P4Eclipse plugin.

The following are the steps that i've used to import a project into eclipse (as described in the video tutorial at the Perforce site).
1. Create New project with default location set to the location where i've synced the files from perforce.
2. Once the project is created, Right-click on project->Team->Share project.
3. In the 'Share project' dialogue box, choose Perforce and give the server configurations.
4. On hitting the Finish button, i get an error message 'Following projects can not be shared, please ensure target locations are defined in the client view and connection is available:

[<project_name>] <project_path>\.project - file(s) not in client view.'

Please help me resolve this issue. An image of the error message may be found in the attached file.

  • Attachment: eclipse.jpg
    (Size: 98.46KB, Downloaded 589 times)
Previous Topic:Compiling with Boost Threads
Next Topic:Drag and drop files to create copy
Goto Forum:
  


Current Time: Thu Mar 28 20:21:45 GMT 2024

Powered by FUDForum. Page generated in 0.06229 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top