Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
From: marcus-sup@bar-coded.net (Marcus Williams)
Subject: [sup-talk] Sup sources question
Date: Mon, 12 Nov 2007 13:29:30 +0000	[thread overview]
Message-ID: <1194873885-sup-8903@tomsk> (raw)
In-Reply-To: <1194840179-sup-2716@south>

On 12.11.2007, William Morgan wrote:
> Just curious if you managed to make this work. I sent an example to the
> list a few weeks back about using console.sh to do just this sort of
> thing.

Yep - cleaned up all of my sources without having to resync. I wrote a
little wrapper tool to do it, might clean up that and post it some
time. For info, the way I did it was almost exactly the way you
suggested (to be run in console.sh):

# remove inbox label and add sent label on all messages coming from a
# single source (id is 3)
Index.ferret.search_each("source_id:3", :limit => :all) do |id, score|
  m = Index.build_message id
  puts "Modifying #{m.id}\t[#{m.labels.join ','}]"
  m.labels.uniq!
  m.labels -= [:inbox] unless m.labels.include? :starred
  m.labels += [:sent]
  puts ".......to #{m.id}\t[#{m.labels.join ','}]"
  Index.sync_message m
end
Index.ferret.optimize

I did notice some messages had a lot of repeated labels. Not sure why,
but calling uniq! fixed it.

Marcus


  reply	other threads:[~2007-11-12 13:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-08 11:18 Marcus Williams
2007-11-08 11:21 ` Marcus Williams
2007-11-12  4:03 ` William Morgan
2007-11-12 13:29   ` Marcus Williams [this message]
2007-11-12 17:20     ` William Morgan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1194873885-sup-8903@tomsk \
    --to=marcus-sup@bar-coded.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox