Re: Jelly script changelogset date issue with Mercurial plugin

2017-07-13 Thread Jesse Glick
On Wed, Jul 12, 2017 at 1:35 PM, Arun Chandrasekaran
 wrote:
> I'm not able to figure out how to convert or embed that into a Jelly.

Do not attempt to put any nontrivial logic into a Jelly view—anything
beyond simple property accesses (`obj.prop`), `j:if` switches, etc.
should be considered suspect. Define Java methods in your plugin that
does all the real work, and have the view just fetch the result.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/CANfRfr08euvxKeBAdH6OknPZKLUCS_GG_9wg%2BUvxB5QTizafSQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Jelly script changelogset date issue with Mercurial plugin

2017-07-13 Thread Arun Chandrasekaran

On Monday, June 26, 2017 at 3:18:22 PM UTC-7, Jesse Glick wrote:
>
> On Mon, Jun 26, 2017 at 6:04 PM, Daniel Beck  > wrote: 
> > That's a long. I think this asks for how to get a human readable date. 
>
> Yes, I left that as an exercise for the reader. My point was that this 
> is the generic API implemented by all SCMs, so there is no special 
> consideration for the `mercurial` plugin. 
>

Thanks Jesse. I'm not able to figure out how to convert or embed that into 
a Jelly.

Here is what I've attempted. Am I missing something?


   ${aUser != null ? aUser.displayName : cs.author.displayName} 
on
${
 java.text.SimpleDateFormat sdf = new 
java.text.SimpleDateFormat("-MMM-dd HH:mm:ss z");
 java.util.Date dt = new java.util.Date(${cs.date});
 sdf.format(dt);
}



-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/6c7ab619-549a-45b7-b416-9d2114271705%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Jelly script changelogset date issue with Mercurial plugin

2017-07-01 Thread Daniel Beck

> On 1. Jul 2017, at 05:40, Oleg Nenashev  wrote:
> 
> So, somebody needs to create a bug to the core

What's the bug? That the API doesn't support every imaginable representation of 
a date?

new Date(x.timestamp) (or rather its equivalent in Jelly) and you're done.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/85552DEA-F6FF-4C4E-87C4-63682D42AFAF%40beckweb.net.
For more options, visit https://groups.google.com/d/optout.


Re: Jelly script changelogset date issue with Mercurial plugin

2017-06-30 Thread Oleg Nenashev
So, somebody needs to create a bug to the core

вторник, 27 июня 2017 г., 0:18:22 UTC+2 пользователь Jesse Glick написал:
>
> On Mon, Jun 26, 2017 at 6:04 PM, Daniel Beck  > wrote: 
> > That's a long. I think this asks for how to get a human readable date. 
>
> Yes, I left that as an exercise for the reader. My point was that this 
> is the generic API implemented by all SCMs, so there is no special 
> consideration for the `mercurial` plugin. 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/577be9e2-334d-404e-be7e-c6a5405cf3f3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Jelly script changelogset date issue with Mercurial plugin

2017-06-26 Thread Jesse Glick
On Mon, Jun 26, 2017 at 6:04 PM, Daniel Beck  wrote:
> That's a long. I think this asks for how to get a human readable date.

Yes, I left that as an exercise for the reader. My point was that this
is the generic API implemented by all SCMs, so there is no special
consideration for the `mercurial` plugin.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/CANfRfr38KsKqCJvpTtnUhwZ2g_P9ECk0NARXXK6LPjUbD5U1bA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Jelly script changelogset date issue with Mercurial plugin

2017-06-26 Thread Daniel Beck

> On 26. Jun 2017, at 23:32, Jesse Glick  wrote:
> 
> http://javadoc.jenkins-ci.org/hudson/scm/ChangeLogSet.Entry.html#getTimestamp--

That's a long. I think this asks for how to get a human readable date.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/6B3D4048-4011-4C17-A5B7-91332390F3AD%40beckweb.net.
For more options, visit https://groups.google.com/d/optout.


Re: Jelly script changelogset date issue with Mercurial plugin

2017-06-26 Thread Jesse Glick
On Mon, Jun 26, 2017 at 4:40 PM, Arun Chandrasekaran
 wrote:
> Is there a way to convert UNIX timestamp to string in the jelly script?

http://javadoc.jenkins-ci.org/hudson/scm/ChangeLogSet.Entry.html#getTimestamp--

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/CANfRfr0Tb3LLkyqJnssw02TWZe2a_POGx8hNd6eZkGg2%3D3b_EQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Jelly script changelogset date issue with Mercurial plugin

2017-06-26 Thread Arun Chandrasekaran
Hi,

I'm reposting this from Jenkins-Users group.

I have a jelly script that displays the ChangeLogSet.date. Here is the 
snippet https://bpaste.net/show/b1dfd27acf66

[image: 
https://09023362727002364442.googlegroups.com/attach/12eced734a856/Auto%20Generated%20Inline%20Image%201?part=0.1=1=ANaJVrH_5fV5jlHx3oXfcGNrojEb0ZMZR2Jb6ewXkJAfoupk-MQRd9Ckd7bPES5NOPMwkpc3Qu7eQZGn8uPaVM41qg2NNsd7AkRjrnn98aYQvuszniwC5F4]

However this displays cs.date as UNIX timestamp, as given by the mercurial 
plugin and not as string format.

Is there a way to convert UNIX timestamp to string in the jelly script? or 
does this require a fix in the Jenkins mercurial plugin?

Any help is appreciated.

Cheers,
Arun

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/3402a93c-643d-461b-8ab5-d476b63ff0e1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.