This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 200946 - Add branch to emails with hg commits
Summary: Add branch to emails with hg commits
Status: RESOLVED FIXED
Alias: None
Product: www
Classification: Unclassified
Component: Builds & Repositories (show other bugs)
Version: 7.1
Hardware: All All
: P3 normal (vote)
Assignee: pgebauer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-15 06:33 UTC by Tomas Mysik
Modified: 2015-07-28 11:27 UTC (History)
2 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tomas Mysik 2011-08-15 06:33:38 UTC
First, not sure what the proper component and subcomponent is, sorry about that.

Please, add branch to emails with hg commits. Jesse could be able to help you with it.

Thanks.
Comment 1 Jesse Glick 2011-08-15 14:00:53 UTC
Specifically, notify_hg.py ought to mention the branch somewhere. Probably {branch} can be used somewhere in single_template and multiple_template. (Not sure if we ever use multiple_template; perhaps not.)

By the way,

{baseurl}{webroot}?cmd=changeset;node={node|short}

is an awkward syntax.

{baseurl}{webroot}/rev/{node|short}

is more commonly used.
Comment 2 Tomas Mysik 2011-08-19 10:31:25 UTC
Any progress, Petře?

Thanks.
Comment 3 pgebauer 2011-09-06 10:41:10 UTC
I have committed the following change http://hg.netbeans.org/nb-hooks/rev/3b7ee3d48642 into the http://hg.netbeans.org/nb-hooks/ repository and have updated the local clone at hg.netbenas.org. I expect that the local clone data are used for the e-mails generation.

Please, let me know if something has changed in the e-mails generation.
Comment 4 Jesse Glick 2011-09-06 20:26:27 UTC
(In reply to comment #3)
> http://hg.netbeans.org/nb-hooks/rev/3b7ee3d48642

{webroot}{project}{branch} will look pretty bad, I think:

"[hg] main-silverdefault: whatever"

(Not sure what {project} is for but it never seems to be substituted with anything.) Better remove {branch} from the subject line. Could go into the body. I tried to improve it in nb-hooks #798e57ad4189.
Comment 5 pgebauer 2011-09-07 12:16:41 UTC
I have updated the local clone by Jesse's change.
Comment 6 Jesse Glick 2011-09-08 18:50:21 UTC
Not working. {branch} resolves to the empty string even for commits on a named branch.
Comment 7 Tomas Mysik 2011-09-09 05:25:03 UTC
(In reply to comment #6)
> Not working. {branch} resolves to the empty string even for commits on a named
> branch.

Weird since from command line, template '{branch}' works for me...
Comment 8 Jesse Glick 2011-09-09 16:42:38 UTC
Right, 'hg help templating' documents it. Either the templating functions are called differently from the notify hook, or the server is running an ancient version of Mercurial that lacks this parameter.
Comment 9 pgebauer 2011-09-13 10:49:39 UTC
An another try to fix: http://hg.netbeans.org/nb-hooks/rev/5d3bb7e602b3
Comment 10 Tomas Mysik 2011-09-13 12:36:16 UTC
(In reply to comment #9)
> An another try to fix: http://hg.netbeans.org/nb-hooks/rev/5d3bb7e602b3

IMHO it won't help; what version of Mercurial is on the server?
Comment 11 pgebauer 2011-09-13 13:02:47 UTC
(In reply to comment #10)
> what version of Mercurial is on the server?

Mercurial Distributed SCM (version 1.4.3)
Comment 12 Tomas Mysik 2011-09-13 13:35:09 UTC
(In reply to comment #11)
> Mercurial Distributed SCM (version 1.4.3)

This version is too old since 1.4.3 was released on 2010-02-01 [1] but the 'branch' keyword was implemented on 2010-12-13 [2].
But, if you have a look at the commit message in [2], maybe we could use:

{branches|nonempty}

Can you try it, please? Thanks.
[1] http://mercurial.selenic.com/wiki/WhatsNew/Archive#A1.4.3_.282010-02-01.29
[2] http://selenic.com/repo/hg/rev/d79fdff55627
Comment 13 pgebauer 2011-09-14 12:05:48 UTC
Is it what you wanted?

http://hg.netbeans.org/nb-hooks/rev/3101141d5868
Comment 14 Tomas Mysik 2011-09-14 13:08:31 UTC
(In reply to comment #13)
> Is it what you wanted?

Yes, we can try it but still, I think that newer version of Mercurial would solve this issue much easier.

Thanks.