'hg log FILE1 FILE2' order depends on the order of the files?

Martin von Zweigbergk martinvonz at google.com
Thu Feb 11 12:33:04 EST 2016


I think the iteration order is undefined, and I think "reverse(...)"
just reverses that undefined order. Try using "sort(..., -rev)"?

On Thu, Feb 11, 2016 at 9:16 AM, Stanislau Hlebik <stash at fb.com> wrote:
> Hey.
>
> We have a library that runs hg and parses its output. Today in one of the
> unittests I've noticed weird behavior: hg log output order depends on the
> order of the filenames.
>
> Unfortunately , I wasn't able to reproduce it outside of test environment. I
> can reproduce it in the test environment easily though.
>
> Has anybody experienced the same problem? Or does anybody have ideas on how
> to debug it?
>
> Below are the commands and theirs output (repo has two commits, file2.txt
> and file3.txt both were changed in each commit):
>
> # file2.txt, file3.txt
> command [u'hg', u'log', u'-r',
> u'reverse(::0902ae52b1289c6e88bbbb55eb59464a1ebbce91)', u'-T', u'{node}
> {p1node} {p2node}\x01', 'file2.txt', 'file3.txt']
>
> history [u'77a1445b59a5dcc7ea92be275fc3457cba9615b1
> 0000000000000000000000000000000000000000
> 0000000000000000000000000000000000000000',
> u'0902ae52b1289c6e88bbbb55eb59464a1eb    bce91
> 77a1445b59a5dcc7ea92be275fc3457cba9615b1
> 0000000000000000000000000000000000000000', u'']
>
> # file3.txt, file2.txt
> command [u'hg', u'log', u'-r',
> u'reverse(::0902ae52b1289c6e88bbbb55eb59464a1ebbce91)', u'-T', u'{node}
> {p1node} {p2node}\x01', 'file3.txt', 'file2.txt']
>
> history [u'0902ae52b1289c6e88bbbb55eb59464a1ebbce91
> 77a1445b59a5dcc7ea92be275fc3457cba9615b1
> 0000000000000000000000000000000000000000',
> u'77a1445b59a5dcc7ea92be275fc3457cba9615b1
> 0000000000000000000000000000000000000000
> 0000000000000000000000000000000000000000', u'']
>
> Thanks,
> Stas
>
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>


More information about the Mercurial-devel mailing list