It's all about the answers!

Ask a question

How to rename multiple files on my workspace?


Ivo Jesus (2112) | asked Jul 23 '15, 6:34 a.m.
 Hi!
I need to rename a lot of files on my workspace. 
Can I make it "one shot" like in MS-DOS?

Thnaks.

3 answers



permanent link
Ralph Schoon (63.1k33645) | answered Jul 23 '15, 8:20 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
You are supposed to use the rename functionality if you have just files or Refactor>Rename if it is Java or another file with a semantic known to the editor.

permanent link
Ralph Schoon (63.1k33645) | answered Jul 23 '15, 7:05 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Eclipse does not have a rename for multiple files. In general it also depends on what files they are and what dependencies they have. If you would just rename Java files, after the rename all java files would be broken, because the imports would be broken. Same for other languages as you probably know.

You want a single file refactor/rename, also to keep the history of the file in SCM.

So my conclusion would be no.

Comments
Ivo Jesus commented Jul 23 '15, 7:53 a.m.

 Thanks for the answer.


permanent link
Ivo Jesus (2112) | answered Jul 23 '15, 8:15 a.m.
edited Jul 24 '15, 6:50 p.m. by Geoffrey Clemm (30.1k33035)

I try a "different way" and manually create a patch.
It's a little slow but do what I need:  it creates the Change Sets with the rename.

Something like that:

### Jazz Patch 1.0
#date: "2015-07-23 11:36:58.000000545 +0100"
#move: "root/dir/file1" "root/dir/file1_v2"
#move: "root/dir/file2" "root/dir/file2_v2"
...
#
Do you foresees any problem, conflict or incompability?

Comments
Geoffrey Clemm commented Jul 24 '15, 6:49 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

If this kind of patch creates the change set that you want, I see no reason not to use this approach.
When RTC creates a patch, it adds a variety of metadata to the patch file, that allows that patch to be used in various advanced scenarios (such as when the file to which you are applying the patch has been previously moved elsewhere), but since you don't need those advanced behaviors, this shouldn't matter to you (assuming RTC is willing to process the patch file without this metadata in it).

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.