Commit Graph

38 Commits

Author SHA1 Message Date
Durham Goode
62867737b2 smartlog: move changelog caching to be after revset
Summary:
When using evolve with the inhibit extension, calling a revset can change the
changelog (since which revs are filtered can change). This affects smartlog
because it tries to cache the changelog functions early on, and there operates
on an old changelog.

Fix this by caching the changelog functions after we've performed the revset.

Test Plan: hg sl -r '<hidden commit> + .'

Reviewers: lcharignon, pyd

Reviewed By: pyd

Differential Revision: https://phabricator.fb.com/D2033643

Signature: t1:2033643:1430357541:21c7a8c07ea8d145af4db40b835a3309239bbe6a
2015-04-07 13:52:11 -07:00
Durham Goode
be069ac108 smartlog: switch to using scmutil.revrange
Summary:
The smartlog rev option wasn't resolving names right because it used
the wrong internal api. Fixes that.

Test Plan: Adds a test

Reviewers: lcharignon, pyd

Reviewed By: pyd

Differential Revision: https://phabricator.fb.com/D2033646

Signature: t1:2033646:1430346864:be69cfb5fe3892f51340546b1fbb341fabfffe14
2015-04-29 15:00:31 -07:00
Durham Goode
fc7e80fa9a smartlog: fix to match upstream 2015-03-13 09:29:29 -07:00
Ryan McElroy
1b69c516cc merge from default 2015-02-24 23:17:46 -08:00
Ryan McElroy
9b28146bb2 smartlog: fix bug in remote bookmark lookup 2015-02-24 23:16:06 -08:00
Ryan McElroy
a16275745c merge from default 2015-02-24 11:51:16 -08:00
Ryan McElroy
01936c5c53 smartlog: fix crash with non-public branches
Summary:
Previously smartlog failed when a branch head was not public.
Fix this and add a test to prevent regression.

Test Plan: New test, ./run-tests.py

Reviewers: ericsumner, sid0, mitrandir, durham

Reviewed By: durham

Differential Revision: https://phabricator.fb.com/D1866905

Tasks: 6120552

Signature: t1:1866905:1424799838:51d5f8501b20dc3757f825ba8a13d38eccec0bff
2015-02-23 22:54:08 -08:00
Ryan McElroy
c247e80cac smartlog: remotenames: always show certain names if they exist
Summary:
With remotenames, we will not always have local bookmarks for important
commits. This introduces a way to ensure important remote bookmark names
are always shows in the commit graph.

Test Plan:
* ./run-tests.py
* manual testing in various repos with remotenames enabled

Reviewers: sid0, daviser, mitrandir, ericsumner, durham

Reviewed By: durham

Differential Revision: https://phabricator.fb.com/D1866949

Signature: t1:1866949:1424798937:ccae85fa3655cfe8171089a3295d42a483f18d08
2015-02-20 15:32:11 -08:00
Ryan McElroy
53576fd0d7 smartlog: bugfix from bad rebase 2015-02-23 11:21:52 -08:00
Ryan McElroy
aee7669af1 smartlog: also consider remote bookmarks, if available
Test Plan: ```./run-tests.py --with-hg=$(which hg) -j 8```

Reviewers: daviser, davidsp, mitrandir, ericsumner, pyd, durham, sid0

Reviewed By: sid0

Differential Revision: https://phabricator.fb.com/D1859454

Tasks: 6274574

Signature: t1:1859454:1424458765:ba337a1d382ee5074efbd1a034bc712d7f44f25e
2015-02-19 15:34:34 -08:00
Ryan McElroy
412f1c3026 smartlog: clean up variable names in revset
Test Plan: ```./run-tests.py --with-hg=$(which hg) -j 8```

Reviewers: durham, daviser, davidsp, mitrandir, ericsumner, pyd, sid0

Reviewed By: sid0

Differential Revision: https://phabricator.fb.com/D1859448

Tasks: 6274574

Signature: t1:1859448:1424455122:af8716a10731b97782dfe0cc31f8c580f00b9f51
2015-02-19 16:13:54 -08:00
Ryan McElroy
5c278c6414 smartlog: clean up variable naming in command
Test Plan: ```./run-tests.py --with-hg=$(which hg) -j 8```

Reviewers: durham, daviser, davidsp, mitrandir, ericsumner, pyd, sid0

Reviewed By: sid0

Differential Revision: https://phabricator.fb.com/D1859445

Tasks: 6274574

Signature: t1:1859445:1424455369:e6e5a49fafa876ca37d4edef4badbda1dd84afc3
2015-02-19 16:10:33 -08:00
Ryan McElroy
264dbf8ad6 smartlog: centralize master option lookup
Test Plan: ```./run-tests.py --with-hg=$(which hg) -j 8```

Reviewers: durham, daviser, davidsp, mitrandir, ericsumner, pyd, sid0

Reviewed By: sid0

Differential Revision: https://phabricator.fb.com/D1859443

Tasks: 6274574

Signature: t1:1859443:1424455198:eeb81ecf0bd66c975b5c39b85710b6cd419912f2
2015-02-19 16:03:41 -08:00
Ryan McElroy
693b970149 smartlog: fix master ordering
Test Plan: ```./run-tests.py --with-hg=$(which hg) -j 8```

Reviewers: daviser, davidsp, mitrandir, ericsumner, pyd, durham, sid0

Reviewed By: sid0

Differential Revision: https://phabricator.fb.com/D1859437

Tasks: 6274574

Signature: t1:1859437:1424455215:f6a02deb5e2ad3cb57001da2dcba7d40fe9571e4
2015-02-19 15:50:16 -08:00
Ryan McElroy
7f8a217b84 smartlog: factor out master rev lookup
Test Plan: ```./run-tests.py --with-hg=$(which hg) -j 8```

Reviewers: durham, daviser, davidsp, mitrandir, ericsumner, pyd, sid0

Reviewed By: sid0

Differential Revision: https://phabricator.fb.com/D1859434

Tasks: 6274574

Signature: t1:1859434:1424455240:a87e5ab451f774966fffe4f720da214c1b8748f1
2015-02-19 15:49:52 -08:00
Ryan McElroy
dae96ce42f smartlog: factor out master revset calculation
Test Plan:
* Updated test

```
./run-tests.py --with-hg=$(which hg) -j 8
```

Reviewers: daviser, davidsp, mitrandir, ericsumner, pyd, sid0, durham

Reviewed By: durham

Differential Revision: https://phabricator.fb.com/D1859427

Tasks: 6274574

Signature: t1:1859427:1424479467:27b4a2ce644c97c04265b93e79332f169f78eda0
2015-02-19 14:39:54 -08:00
Durham Goode
6b82267a16 Merge with default 2015-02-13 11:34:05 -08:00
Ryan McElroy
a147066185 smartlog: allow master to be specified in configuration
Summary:
This allows each repo to specify a master revision other than ##master##,
 ##trunk##, or ##@##. This is especially useful when using the ##remotenames##
extension, since the remote bookmark might be of the form ##remote/master##.

Test Plan:
Set this cofig option in my repo's .hg/hgrc:

  [smartlog]
  master = smf/@

Then ran smartlog and it worked as if I had passed ##--master smf/@##

Reviewers: sid0, daviser, davidsp, ericsumner, mitrandir, durham

Reviewed By: durham

Differential Revision: https://phabricator.fb.com/D1840345

Signature: t1:1840345:1423625389:aec4d651a23747bc5fdce3f14b26158ad0ddf313
2015-02-10 19:11:19 -08:00
Eric Sumner
f4ead350b0 Merge w/ default 2015-01-29 13:40:50 -08:00
Eric Sumner
b630a5a622 smartlog: config option to ignore bookmarks
Summary:
I have some bookmarks for interesting code that I've stopped
development of indefinitely, and I don't want them cluttering
my smartlog output.  This lets me add a config option like

  [smartlog]
  ignorebookmarks = abandoned/

so that smartlog won't force them to be included

Test Plan: ##run-test.py##

Reviewers: sid0, daviser, davidsp, mitrandir, rmcelroy, durham

Reviewed By: durham

Subscribers: calvinb, mpm, pyd, akushner

Differential Revision: https://phabricator.fb.com/D1812758

Signature: t1:1812758:1422567344:d44896000ea3f92dbd0b981fc26693066ab23ee1
2015-01-29 11:32:37 -08:00
Eric Sumner
a5c0bda96f merge from default 2015-01-22 11:34:42 -08:00
Eric Sumner
1c0fd006c9 smartlog: add revset function
Summary:
I wanted a way to see a commit in relation to the other smartlog entries, so
I refactored smartlog to provide a revset function for its default selections.

Test Plan: ##run-tests##

Reviewers: durham

Reviewed By: durham

Differential Revision: https://phabricator.fb.com/D1794762

Tasks: 6057467

Signature: t1:1794762:1421888058:9b96d26f68b9b3bac24ef43db58fe8aa0299de37
2015-01-21 12:20:33 -08:00
Tiina Turban
07f9a3036f commit-info flag for smartlog
Summary: `hg sl/slog/smartlog` has a new flag `--commit-info`, which shows the files changed in currently active commit.

Test Plan:
Modified & added & removed a file to in commit.
The deleted, unknown, ignored and clean are not relevant, when we are talking about a change in a commit - right?

  hg sl
  hg sl --commit-info
  hg sl -T "blaa" --commit-info
  hg slog
  hg slog --commit-info
  hg slog -T "blaa" --commit-info

Commit-info flag adds info under current commit about the added, modified & removed files.

  hg sl --commit-info --stat
This looks weird as it shows the current commit changes twice. Should I care about this?

  #in fb-hgext/tests
  ./run-tests.py  test-smartlog.t

test passes.

Reviewers: sid0, pyd, davidsp, durham

Reviewed By: durham

Differential Revision: https://phabricator.fb.com/D1677101

Tasks: 5418936

Signature: t1:1677101:1415833805:975ce43aaaf1ccabe6a054d09a9e5f236447340f
2014-11-10 18:45:39 -08:00
Tiina Turban
e0861c5223 Noticed an exception running 'hg sl --all' (in fb-hgext repo)
Summary:
In 'getdag' method, when 'order' is empty then the sorting key .index throws an exception.
http://i.imgur.com/t0XHtgJ.gif

Test Plan:
Before 'hg sl --all' throw an exception (in fb-hgext repo), after change it showed the revisions (no exception).

[[ https://www.facebook.com/pxlcld/lLsB | before ]]

[[ https://www.facebook.com/pxlcld/lLsz | after ]]

Reviewers: durham

Reviewed By: durham

Differential Revision: https://phabricator.fb.com/D1650845

Signature: t1:1650845:1415327848:87d913231c4796f1f05b075cdbd4d67740695a5c
2014-10-30 16:01:50 -07:00
Tiina Turban
7f5fc354f5 Noticed an exception running 'hg sl --all' (in fb-hgext repo)
Summary:
In 'getdag' method, when 'order' is empty then the sorting key .index throws an exception.
http://i.imgur.com/t0XHtgJ.gif

Test Plan:
Before 'hg sl --all' throw an exception (in fb-hgext repo), after change it showed the revisions (no exception).

[[ https://www.facebook.com/pxlcld/lLsB | before ]]

[[ https://www.facebook.com/pxlcld/lLsz | after ]]

Reviewers: durham

Reviewed By: durham

Differential Revision: https://phabricator.fb.com/D1650845

Signature: t1:1650845:1415327848:87d913231c4796f1f05b075cdbd4d67740695a5c
2014-10-30 16:01:50 -07:00
Siddharth Agarwal
b4c11162d8 fix smartlog for Mercurial changes
Summary:
Use `first()` instead of `[0]`.

Also fix coloring under non-ANSI terminals (required to get the test working).

Test Plan: Ran the tests. Also ran `hg sl` with this in a few of my repos.

Reviewers: durham, davidsp, akushner, daviser, rmcelroy, pyd

Reviewed By: pyd

Differential Revision: https://phabricator.fb.com/D1623808

Tasks: 5375006
2014-10-17 13:35:52 -07:00
Siddharth Agarwal
7a87af3b49 fix smartlog for Mercurial changes
Summary:
Use `first()` instead of `[0]`.

Also fix coloring under non-ANSI terminals (required to get the test working).

Test Plan: Ran the tests. Also ran `hg sl` with this in a few of my repos.

Reviewers: durham, davidsp, akushner, daviser, rmcelroy, pyd

Reviewed By: pyd

Differential Revision: https://phabricator.fb.com/D1623808

Tasks: 5375006
2014-10-17 13:35:52 -07:00
Pierre-Yves David
67107ae073 smartlog: simplify the coloration code with a list compression
Shorte, easier to read.
2014-06-10 16:53:53 -07:00
Pierre-Yves David
ff0aee50eb smartlog: simplify the coloration code with a list compression
Shorte, easier to read.
2014-06-10 16:53:53 -07:00
Pierre-Yves David
67fbcd0156 smartlog: turn obsolete changeset grey
He highlight the "undead" status of obsolete changeset by turning them grey, the
same way the current changeset is highlighted with purple.
2014-06-10 16:52:48 -07:00
Pierre-Yves David
7e0d5ef381 smartlog: turn obsolete changeset grey
He highlight the "undead" status of obsolete changeset by turning them grey, the
same way the current changeset is highlighted with purple.
2014-06-10 16:52:48 -07:00
Durham Goode
7321a5e343 Initial commit with extensions and readme 2014-06-02 12:54:54 -07:00
Durham Goode
600db95fd4 Fix smartlog commit sorting
Smartlog is supposed to sort commits such that master is a straight line on the
left. This broke in the last commit because we passed master as 'master' instead
of as a rev number to the sorter.
2014-04-18 14:33:17 -07:00
Durham Goode
43e3b0f991 Fix a number of bugs in smartlog
- Adds a -r flag that allows you to view the smartlog of any arbitrary set of
  commits. It displays those commits, how they are related, and the common
  ancestor.

- Fixes a dag bug where a node with ancestors from seperate lineages would not
  have a line drawn to the first ancestor. This was because the fake node logic
  overwrote the original fake node when it saw the second one.

- Fixes smartlog to work better with branches. Previously it only ever hid
  commits that were ancestors of the 'master' commit. Now, if you are on a
  different branch from the master, we will also show the tip most public commit
  on that branch, and hide all of it's ancestors. If you are on the master
  branch, nothing has changed.

- Add a warning message at the bottom of the output when we know we're hiding
  old heads from you. Adds a --all flag for showing all heads, even old ones.
2014-04-17 18:49:11 -07:00
David Soria Parra
58032903f4 Bail if revision set is empty 2014-03-21 16:28:00 -07:00
Durham Goode
238a5915c7 Fix hg smartlog when current commit is nullrev.
Fix hg smartlog --master option to actually work.
Add help text.
2013-09-05 14:24:01 -07:00
Durham Goode
6675d8181b Make smartlog more robust on crazy repos
If the repo had a lots of heads, the ancestor revset would previously cause
a stack overflow in the revset parser. I changed it to not use revsets at all.

If the repo had a merge, the ancestor walk code was sometimes adding the
entire repo to the rev list.  I changed it to only add nodes that are > the
common ancestor.

Added smartlog to the default pager attend list.
2013-07-20 20:30:11 -07:00
Durham Goode
f39da261ad Install to site-packages/ instead of site-packages/hgext 2013-06-20 14:56:01 -07:00