Re: [Trac] Re: Possible to render a specific log revision in ticket comment?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 03.01.2015 08:20, Leho Kraav wrote: > On 03.01.2015 00:48, RjOllos wrote: >> On Sunday, December 21, 2014 3:47:49 PM UTC-8, Leho Kraav wrote: >> >> I'm thinking something like this for a macro >> >> [[Diff(repository:revision)]] >> >> Does anything similar to this already exist? th is taking about 5 >> minutes to load any page, can't check hack index. >> >> >> Just to be sure, you want to display the diff, and not just the log >> message? I haven't seen anything like that on t-h.o, but a Changeset >> macro would be a valuable addition to Trac. >> > > Yeah. It can be used for avoiding pasting code into wiki when > documenting examples and also as a lightweight, model-free code review > tool in ticket comments. With psuter's autocomplete magic from > http://trac-hacks.org/intertrac/WikiAutoCompletePlugin picking a > revision to use for the macro could be a really nice experience. > Feels like most of the required logic is already in Trac core, but has to get rendered inline for the wiki macro call rather than dedicated changeset page. If it was so smart to accept a path as optional argument, one could display exactly what is shown at corresponding Trac browser pages when showing diffs reduced to a directory or file. Steffen Hoffmann -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.12 (GNU/Linux) iEYEARECAAYFAlSnng8ACgkQ31DJeiZFuHfV4wCgxw85Fd9/5Vto5wibIPuDhtEy r2sAnj7U8Fcg8FamzdCghg0pRAjF9pxf =QMyJ -END PGP SIGNATURE- -- You received this message because you are subscribed to the Google Groups "Trac Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscr...@googlegroups.com. To post to this group, send email to trac-users@googlegroups.com. Visit this group at http://groups.google.com/group/trac-users. For more options, visit https://groups.google.com/d/optout.
Re: [Trac] Re: Possible to render a specific log revision in ticket comment?
On 03.01.2015 00:48, RjOllos wrote: On Sunday, December 21, 2014 3:47:49 PM UTC-8, Leho Kraav wrote: I'm thinking something like this for a macro [[Diff(repository:revision)]] Does anything similar to this already exist? th is taking about 5 minutes to load any page, can't check hack index. Just to be sure, you want to display the diff, and not just the log message? I haven't seen anything like that on t-h.o, but a Changeset macro would be a valuable addition to Trac. Yeah. It can be used for avoiding pasting code into wiki when documenting examples and also as a lightweight, model-free code review tool in ticket comments. With psuter's autocomplete magic from http://trac-hacks.org/intertrac/WikiAutoCompletePlugin picking a revision to use for the macro could be a really nice experience. -- You received this message because you are subscribed to the Google Groups "Trac Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscr...@googlegroups.com. To post to this group, send email to trac-users@googlegroups.com. Visit this group at http://groups.google.com/group/trac-users. For more options, visit https://groups.google.com/d/optout.
[Trac] Re: Possible to render a specific log revision in ticket comment?
On Sunday, December 21, 2014 3:47:49 PM UTC-8, Leho Kraav wrote: > > I'm thinking something like this for a macro > > [[Diff(repository:revision)]] > > Does anything similar to this already exist? th is taking about 5 minutes > to load any page, can't check hack index. > Just to be sure, you want to display the diff, and not just the log message? I haven't seen anything like that on t-h.o, but a Changeset macro would be a valuable addition to Trac. -- You received this message because you are subscribed to the Google Groups "Trac Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscr...@googlegroups.com. To post to this group, send email to trac-users@googlegroups.com. Visit this group at http://groups.google.com/group/trac-users. For more options, visit https://groups.google.com/d/optout.
Re: [Trac] Issues trying to migrate/upgrade Trac projects to new server
On Thursday, January 1, 2015 11:23:02 PM UTC-8, Greg Earle wrote: > > On Jan 1, 2015, at 9:36 PM, RjOllos wrote: > > > > But now we have a problem; clearly in this Template page there is a > > > 'placeholder' for the attached image, but because it's not attached, > > > "trac-admin upgrade" won't drag it along for the ride. > > > > Do you know how the attachments were added to the environment in the > first place? Did the user manually add them to the environment's > attachments directory? If they were added through the Web interface or > using TracAdmin, then there should be an entry in the database. > > Sadly I don't, and won't until our vacation is over (next Monday) > at the earliest. > > > > So unless the user (who is on vacation right now, unfortunately) goes > > > back and attaches all of these images/docs (on 16 sets of Projects!), > > > they won't be available in the new 1.0.2 server environment to > re-attach > > > them later. > > > > You could script the operations so that the user doesn't have to > manually insert the attachments to every environment. > > > > Before upgrading, you could write a short script to inspect the > attachments directory and insert the attachment in the case that there is > not a reference to the attachment in the database. From the directory > structure prior to upgrading you know the parent realm, parent resource and > resource id of each attachment. You can use that to construct a query to > determine if there is an entry in the attachments table, then insert a row > if the entry doesn't exist. > > > > You probably don't even need to write the queries yourself, you could > just use the methods of the Attachment class: > > > > http://trac.edgewall.org/browser/tags/trac-1.0.2/trac/attachment.py#L121 > > Probably beyond my meagre understanding of Trac and my Python abilities, > but I'll have a look anyway. > > > Another way to script this is to move the existing file out of the > attachments directory, and use the TracAdmin command line tool to attach it > to the appropriate resource. This will create the entry in the attachments > table and then put the attachment back into the directory. > > That sounds a lot more promising! Because the unattached files/structure > is the same for all these 16 projects, it can probably be scripted. > > How do I get the attachment list/realm:id? > > -- > Trac [/var/trac/projects/test_project]> attachment list > Error: Invalid arguments > > attachment list > > List attachments of a resource > > The resource is identified by its realm and identifier. > -- > > Thanks, > > - Greg > Could you try the script below on a copy of your environment? The script will inspect all the files in the environment attachment's directory, and if the attachment doesn't exist in the database but the parent resource does exist, an entry will be added in the database for the attachment. Run it as: $ python repair_attachments.py /path/to/env #!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2015 Edgewall Software # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://trac.edgewall.org/wiki/TracLicense. # # This software consists of voluntary contributions made by many # individuals. For the exact contribution history, see the revision # history and logs, available at http://trac.edgewall.org/log/. import os import sys import tempfile from trac.attachment import Attachment from trac.env import Environment from trac.resource import Resource, ResourceNotFound, resource_exists def main(): env_dir = os.path.abspath(sys.argv[1]) env = Environment(env_dir) attachments_dir = os.path.join(env_dir, 'attachments') temp_dir = tempfile.mkdtemp() for dir_path, _, file_names in os.walk(attachments_dir): for file_name in file_names: rel_path = dir_path[len(attachments_dir)+1:] parent_realm, parent_id = os.path.split(rel_path) try: Attachment(env, parent_realm, parent_id, file_name) except ResourceNotFound: parent_resource = Resource(parent_realm, parent_id) if resource_exists(env, parent_resource): attachment_path = os.path.join(dir_path, file_name) temp_path = os.path.join(temp_dir, file_name) attachment = Attachment(env, parent_realm, parent_id) attachment.author = 'admin' print("Repairing attachment %s" % os.path.join(rel_path, file_name)) os.rename(attachment_path, temp_path) with open(temp_path, 'r') as file_obj: file_size = os.fstat(file_obj.fileno()).st_size attachment.insert(file_name, file_obj, file_size
[Trac] Re: Warning: The change has been saved, but an error occurred while sending notifications: [Errno -2] Name or service not known
On Thursday, January 1, 2015 11:16:16 PM UTC-8, Golden John wrote: > > Whenever i was updated the ticket , the changes has been saved , But we > are seeing the below error once the ticket has been updated. > > Warning: The change has been saved, but an error occurred while sending > notifications: [Errno -2] Name or service not known > > [notification] > > admit_domains = > > always_notify_owner = true > > always_notify_reporter = true > > always_notify_updater = true > > ignore_domains = > > mime_encoding = base64 > > sendmail_path = sendmail > > smtp_always_bcc = > > smtp_always_cc = > > smtp_default_domain = > > smtp_enabled = true > > smtp_from = yourname@… > > smtp_from_name = server01 trac > > smtp_password = x > > smtp_port = 80 > > smtp_replyto = > > smtp_server = smtpout.secureserver.net > > smtp_subject_perfix = test > > smtp_user = yourname@… ticket_subject_template = $prefix #$ticket.id: > $summary > > use_public_cc = true > > use_short_addr = flase > > use_tls = false > > kindly give us any conclusion for this scenario. > Your SMTP server information is most likely incorrect. You can find some troubleshooting steps here: http://trac.edgewall.org/wiki/TracNotification#Troubleshooting Particularly, make sure to enable DEBUG logging to see if there is more details info available in the log. Are you using a hosting service? If so, then you may want to look to them for the proper SMTP configuration settings. -- You received this message because you are subscribed to the Google Groups "Trac Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscr...@googlegroups.com. To post to this group, send email to trac-users@googlegroups.com. Visit this group at http://groups.google.com/group/trac-users. For more options, visit https://groups.google.com/d/optout.
[Trac] Re: Warning: The change has been saved, but an error occurred while sending notifications: [Errno -2] Name or service not known
On Friday, 2 January 2015 12:46:16 UTC+5:30, goldenjohn51 wrote: > > Whenever i was updated the ticket , the changes has been saved , But we > are seeing the below error once the ticket has been updated. > > Warning: The change has been saved, but an error occurred while sending > notifications: [Errno -2] Name or service not known > > [notification] > > admit_domains = > > always_notify_owner = true > > always_notify_reporter = true > > always_notify_updater = true > > ignore_domains = > > mime_encoding = base64 > > sendmail_path = sendmail > > smtp_always_bcc = > > smtp_always_cc = > > smtp_default_domain = > > smtp_enabled = true > > smtp_from = yourname@… > > smtp_from_name = server01 trac > > smtp_password = x > > smtp_port = 80 > > smtp_replyto = > > smtp_server = smtpout.secureserver.net > > smtp_subject_perfix = test > > smtp_user = yourname@… ticket_subject_template = $prefix #$ticket.id: > $summary > > use_public_cc = true > > use_short_addr = flase > > use_tls = false > > kindly give us any conclusion for this scenario. > > > , Please find the attached image for the reported problem . > > > -- You received this message because you are subscribed to the Google Groups "Trac Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscr...@googlegroups.com. To post to this group, send email to trac-users@googlegroups.com. Visit this group at http://groups.google.com/group/trac-users. For more options, visit https://groups.google.com/d/optout.