Skip to content

Commit

Permalink
smartlog: fix indentnonpublic when public rev is 0
Browse files Browse the repository at this point in the history
Summary: Observed this bug when I was creating an example repo.

Reviewed By: sggutier

Differential Revision: D68914044

fbshipit-source-id: bf63fd5520e893325512655b98bce871d226c7c1
  • Loading branch information
quark-zju authored and facebook-github-bot committed Jan 31, 2025
1 parent ac54ffa commit 4ea204d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion eden/scm/sapling/ext/smartlog.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def unzip(parents):
if pctx.ispublic():
prev = results[i][0]
break
if prev:
if prev is not None:
reserved.append(prev)

return results, reserved
Expand Down
11 changes: 11 additions & 0 deletions eden/scm/tests/test-fb-ext-smartlog.t
Original file line number Diff line number Diff line change
Expand Up @@ -404,3 +404,14 @@ Make sure public commits that are descendants of master are not drawn
~

Indent non-public when public rev is 0:

$ newrepo
$ echo 'A-B' | drawdag
$ sl debugmakepublic $A
$ sl dbsh -c "cl.inner.flush([bin('$A')])" # reassign $A to "master group" so its rev is 0
$ sl smartlog -T '{rev} {desc} {phase}' --config smartlog.indentnonpublic=1
o 281474976710656 B draft
╭─╯
o 0 A public

0 comments on commit 4ea204d

Please sign in to comment.