Closed Bug 1238623 Opened 7 years ago Closed 7 years ago

Allow calling pushlog_client functions with tipsonly=False


(Developer Services :: Mercurial:, defect)

Not set


(Not tracked)



(Reporter: armenzg, Assigned: sabergeass)



(1 file)

55 bytes, text/x-github-pull-request
: review+
Details | Review
When calling query_pushes_by_revision_range [1], we define tipsonly=1 by default.

In this block
>    url = "%s?fromchange=%s&tochange=%s&version=%d&tipsonly=%d" % (
>       JSON_PUSHES % {"repo_url": repo_url},
>       from_revision,
>       to_revision,
>       version,
>       tipsonly
>   )
we should not assume that tipsonly is always specified.
This was introduced incorrectly by me [2]

The default value should be True (to keep backwards compatibility).
If True, we append &tipsonly=1, otherwise, we don't.
We also need to update the docstring.

We should also modify the Push class to indicate that *only* the tip changeset have been loaded [3].

For instance,
> pushes = query_pushes_by_revision_range(repo_url='', from_revision='a29f3fd54de2', to_revision='a29f3fd54de2')
> print pushes
[<Push id:96174 info:{'date': 1446750429, 'changesets': [<changeset {'node': u'a1e682c00ff34c054a1217a8f057038cc8f8ffbb'}>], 'user': u''}>]

The push in that example is this one [4], however, the pushes object return does not make *any* mention of a29f3fd54de2. This is because a1e682c00ff3 is the tip most changeset and we have called tipsonly=1.

Hence, *all* pushes objects created with date from querying tipsonly=1 will *only* have information about the tip most changeset and not all other ones.

We should write a test for this as well.

Unfortunately, every call on pushlog_client has tipsonly=1 hard coded.

This has not caused any bugs on mozci because we *only* care about tipmost changesets for pushes, however, the current logic is incorrect.

We should mark a Push with a member to indicate that *only* tip most information has been provided when initialized.

A side note, version=2 should be changed for version=VERSION and create a constant at the top with VERSION=2.

Assignee: nobody → sabergeass
Attached file PR for bug 1238623
Hope it's good to go :)
Attachment #8708677 - Flags: review?(armenzg)
Attachment #8708677 - Flags: review?(armenzg) → review+
Bug 1238623 - Allow calling pushlog_client functions with tipsonly=False. r=armenzg
Landed and released.
Thanks MikeLing!
Closed: 7 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.