This is an archive of the discontinued Mercurial Phabricator instance.

smartlog: do not draw public commits between draft commits and master
ClosedPublic

Authored by stash on Jul 21 2017, 8:41 AM.
Tags
None
Subscribers

Details

Summary

We've seen a couple of issues when there are lots of public commits between a
head and master bookmark. Smartlog tries to draw all of the public commits
and drawing it can be too slow. See example below

   o - some commit that smartlog wants to draw
  /
o
.
.    -- many commits
.
o  - master bookmarks

This issue happens often while using infinitepush extension.
Let's fix it by drawing just one public commit between a head and master.
We could of course avoid drawing this public commit at all, but in that case
output would be smth like

   o - some commit that smartlog wants to draw
  /
o
|     - many commits in betwee, but user doesn't see it because there are no dots
o  - master bookmarks
Test Plan

Slowly run tests

Diff Detail

Repository
rFBHGX Facebook Mercurial Extensions
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

stash created this revision.Jul 21 2017, 8:41 AM
ryanmce edited the summary of this revision. (Show Details)Jul 21 2017, 8:48 AM
ryanmce accepted this revision.Jul 21 2017, 8:53 AM
ryanmce added a subscriber: ryanmce.

Nice! This will also help a lot with release branches.

hgext3rd/smartlog.py
546–548

grammar-nit: s/found/find (alternatively, use "have found")

I could go into the grammar details of why, but just trust me on this one :-)

This revision is now accepted and ready to land.Jul 21 2017, 8:53 AM
stash added inline comments.Jul 21 2017, 9:26 AM
hgext3rd/smartlog.py
546–548

Trust you and will fix. But still curious to know the details :)

stash updated this revision to Diff 363.Jul 21 2017, 9:29 AM

addressed comments

ryanmce added inline comments.Jul 21 2017, 10:38 AM
hgext3rd/smartlog.py
546–548

We should probably also add an indefinite article in here:

stop as soon as we find a public commit

As for the english lesson (I'm not an expert here, but this is my understanding):

"found" is the past participle of "to find", and generally, you need to use "have" in front of the past participle.

Unfortunately, it's a little more complicated (as always in English) because "found" is also the past-tense of "to find".

It's easier to see if you use a verb that doesn't have these overlapping conjugations. Take "to eat" as an example.

  • Infinitive: to eat
  • Past tense: ate
  • Part participle: eaten

So, it sounds okay to say "we ate that" but "we eaten that" sounds very weird. Instead, you'd say "we have eaten that".

Now, coming back to your use of "found": if it's both a past participle and a past tense, why did it sound weird to me? To figure this out, I had to look at the full phrase (Note that I'm adding the "a" in here to make it more correct-sounding as well):

stop as soon as we found a public commit

The issue is that "stop" is the present imperative (command) tense, and it's a tense mismatch to combine the present-tense "stop" with the past-tense "found". Thus, even though "we found a public commit" sounds fine, it doesn't work as the dependent clause to "stop as soon as".

Yet, it's okay to use the past participle form "have found" because the present-tense "stop" happens only after we have found the public commit.

So, going back to the "to eat" example:

jump after we ate the food

Whereas these work:

EXAMPLE
jump after we have eaten the food
jump after we eat the food

Also you can make everything past-tense to sound okay as well:

EXAMPLE
you jumped after we ate the food
stash added inline comments.Jul 21 2017, 10:43 AM
hgext3rd/smartlog.py
546–548

Hm, probably I get it. Since stop is in present tense, then we should use present or present perfect in the other clause. But then stopped as soon as we found a new commit is correct, isn't it?

This revision was automatically updated to reflect the committed changes.