0

I'm not going to get into the discussion on how to set up mercurial for a Drupal multi-site installation, but I've run across something that's boggling my mind. I have a drupal multi-site installation which I'm trying to set version control up on. What I've done is to hg init in the Drupal Root, with an .hgignore that ignores drupal_root/sites/. This is what Is in my .hgignore, and it seems to be working fine:

# Glob syntax
syntax: glob
# Everything in sites
sites/*

This is working just fine, as mercurial finds everything else besides the sites folder. Now, inside the sites folder, the structure looks like this:

sites/
    sites/all
    sites/default
    sites/domain1.com
    sites/domain2.com

My problem is that when I do hg status inside sites, mercurial will not find sites/all/modules. I've tried multiple permutations of .hgignore, as I'd like to ignore sites/domain1.com/files, but nothing seems to work. I even deleted the repo, and started over without any .hgignore at all. sites/all/libraries and sites/all/scripts both show up just fine.

Could the .hgignore in the parent directory have something to do with it?

UPDATE: I just completely removed the sub-repo (I know it's not actually a sub-repo, but I'm limited here) deleted the repo in drupal root, and started over treating the entire installation as a single repo. Same thing, mercurial just will not find root/sites/all/modules.

UPDATE: @Ry4an - The behavior in the drupal root directory is correct. I'm trying to emulate sub-repositories since I'm stuck using Hg 1.3, which doesn't really implement them. So, my directory structure looks like this:

drupal_root/
    .hg/
    modules/
    includes/
    themes/
    sites/
        .hg/
        all/
        default/
        domain1.com/
        domain2.com/

So, I do want the repository inside drupal_root to ignore everything under drupal_root/sites, but I have a second repository inside drupal_root/sites that should handle everything there. That's the repo that's not finding everything.

ditch182
  • 318
  • 1
  • 12

3 Answers3

0

What you're seeing is the behavior I'd expect. This glob rule:

syntax: glob
# Everything in sites
sites/*

ignores everything in sites, which includes 'sites/all', so Mercurial won't be looking down inside 'all' at all, so it won't see 'sites/all/modules'.

If you provide a full list of files and their paths annotated with what files you want ignored and what files you don't want ignored I'm sure someone can help you come up with the right rules, but it's not entirely clear from your question.

Ry4an Brase
  • 78,112
  • 7
  • 148
  • 169
0
  • If you task is "ignore all, except one dir"
  • If you can write (and test) regexps

you can consult with this question and accepted answer in order to adopt regexp to your conditions

Another (slightly more inaccurate) solution can be

  • leave current "ignore all" pattern
  • add all files in sites/all/modules into repo by hand (hgignore ignore only untracked objects)
  • don't forget all new files, added later into modules, add explicitly to Mercurial (they will be ignored by rule)
Community
  • 1
  • 1
Lazy Badger
  • 94,711
  • 9
  • 78
  • 110
0

Well, I feel like an idiot. The problem was that there was already a repository inside drupal_root/sites/all/modules. I don't remember putting it there, but it seems that mercurial ignores any directory that already contains a .hg directory. Thanks for the help everyone.

ditch182
  • 318
  • 1
  • 12