The easter egg among the includes folder files is locale.inc. Unlike any other file there, it is not some general functionality for use by several Drupal modules, but instead an extract of the locale module administration functionality, so turning on locale.module does not bring down sites with small resources, with its lots of code. Locale.inc was a pioneer in the "a module is not necessarily good in one standalone file" thinking, which is turning into Drupal 4.8 having multiple files per module. Now that modules have separate folders, it is the time to identify locale.inc as a file belonging closely to locale.module and not to the other include files.

To retain history, locale.inc should be moved on the CVS server, as the module files were moved. The patch for locale.module to include the file from the new place is attached.

CommentFileSizeAuthor
Drupal.locale-inc-move.patch.txt2.33 KBgábor hojtsy

Comments

dries’s picture

Moving it on the CVS server is a little tricky as we don't want to break older branches. We can consult dww about this.

dww’s picture

at your service... ;)

dries, i think all you'd need to do is take my most recent cvs_rename.pl, and invoke it like so:

  1. login to a shell on the machine where the repository lives
  2. backup repository
  3. checkout a copy of drupal core (from HEAD)
  4. cd into the root of this core workspace (the "drupal" directory, where index.php, update.php, etc, all live)
  5. cvs_rename.pl -v -m '#73507: ' -r /full/path/to/cvs/repo/on/disk/drupal includes/locale.inc modules/locale/locale.inc

to translate that command-line:

-v
verbose
-m '#73507: '
appends this issue # to the cvs commit messages involved
-r /full/path/to/cvs/repo/on/disk/drupal
this has to be the full path to the directory in the filesystem where the repository actually lives, so that the script can directly manipulate (copy, in this case) some of the foo,v files (locale.inc,v in this case)
includes/locale.inc
old location (relative to your current working dir, which is why step #4 is relevent)
modules/locale/locale.inc
new location (relative to your current working dir...)

that should be it. dries, if you want live help, catch me on IRC. otherwise, it should be pretty straight-forward. let me know if any of this doesn't make sense.

thanks,
-derek

dries’s picture

$ ./cvs_rename.pl -v -m 'Patch #73507: move locale module' -r /cvs/drupal/drupal includes/locale.inc modules/locale/locale.inc
+ cp /cvs/drupal/drupal/includes/locale.inc,v /cvs/drupal/drupal/modules/locale/locale.inc,v
+ rm includes/locale.inc
+ cvs remove includes/locale.inc
cvs remove: scheduling `includes/locale.inc' for removal
cvs remove: use `cvs commit' to remove this file permanently
+ cvs update modules/locale/locale.inc
cvs update: nothing known about `modules/locale/locale.inc'
+ cvs tag -d DRUPAL-4-7-2 modules/locale/locale.inc
cvs tag: nothing known about locale.inc
cvs [tag aborted]: correct the above errors first!
cvs tag -d DRUPAL-4-7-2 modules/locale/locale.inc: Bad file descriptor at ./cvs_rename.pl line 214.
drumm’s picture

Status: Reviewed & tested by the community » Needs work

Looks like it needs work.

dww’s picture

i tried to help dries with this interactively the other day, but he didn't really have time. it's not at all clear why he was having trouble -- that "cvs update" step that failed for him works just fine for me. :( i just need to help dries figure out what's different about his setup. but yeah, i guess "needs work" is a more appropriate status...

gábor hojtsy’s picture

This would nicely clean up the locale code at large at least.

gerhard killesreiter’s picture

Dries, should I help with that?

dww’s picture

apparently the bzr-mirror fanatics among us are upset with my cvs_rename.pl script. they claim it confuses "tailor", which does the bzr sync'ing. they further claim there's a better way to do one of the steps in the cvs_rename.pl script that wouldn't confuse things. hunmonk is trying to arrange a chance for these folks to chat w/ me so i can learn about their proposed method, and pass judgement. ;)

therefore, please hold off on running cvs_rename.pl until we get it figured out (in the next few days). i'll follow-up here with either a new version of cvs_rename.pl, or an "all clear", and set this to RTBC.

thanks,
-derek

gábor hojtsy’s picture

Version: x.y.z » 5.0-rc1
Assigned: gábor hojtsy » Unassigned

Would it be possible to fix this in the 5.x release? It does not seem to be so hard since moving of files with histories was offered for sandbox owners too, so some solution must be in place.

gábor hojtsy’s picture

Version: 5.0-rc1 » 6.x-dev
Status: Needs work » Reviewed & tested by the community

So could we do this earily in the 6.x release cycle to clean up this situation?

dww’s picture

Status: Reviewed & tested by the community » Needs work

what needs work is the cvs_rename.pl script, not your idea/proposal/etc. i'm sure that's RTBC. however, the rename script needs a little more tweaking (there were some small problems from the last major rename to split modules into their own subdirs in the first place).

so, i'm planning to fix all of that and make the script happy to avoid these problems in the future, before we rename any more core files. i'd like to get to this soon, but as always, i've got an infinite mountain of work to try to complete.

sorry,
-derek

pancho’s picture

Version: 6.x-dev » 7.x-dev

Now if we want to do this early in the release cycle, it has to be D7...

Crell’s picture

Status: Needs work » Closed (duplicate)

Yaknow, I'm actually going to call this a duplicate of: http://drupal.org/node/187398

Of course, that didn't make it into Drupal 6 either. :-( Come Drupal 7 there will likely be even more module slicing and dicing and more files on disk to give dww a headache. Sorry, dww.