Commit Graph

11 Commits

Author SHA1 Message Date
Laurent Charignon
cfe353bb20 cleanup: fix naked exception clauses
Summary: This diff is part of a series to cleanup fb-hgext and make it pass check-code.

Test Plan: all tests pass

Reviewers: #sourcecontrol, ttung

Differential Revision: https://phabricator.fb.com/D2812062
2016-01-07 18:30:24 -08:00
Laurent Charignon
cc97eef022 cleanup: fix spacing (2 vs 4 spaces)
Summary: This diff is part of a series to cleanup fb-hgext and make it pass check-code.

Test Plan: all tests pass

Reviewers: #sourcecontrol, ttung

Differential Revision: https://phabricator.fb.com/D2811933
2016-01-07 18:30:24 -08:00
Laurent Charignon
ae933b4f58 morestatus: fix deprecation warning
Summary: repo.parents() is deprecated, we should use repo[None].parents()

Test Plan: Test is still passing

Reviewers: cdelahousse, durham

Differential Revision: https://phabricator.fb.com/D2770918
2015-12-18 18:05:35 -08:00
Christian Delahousse
b43aa75c43 morestatus: fix mergestate.active crashing with hg 2015-12-04 release
Summary:
Something changed in upstream hg to make mergestate.active blow up without when
not no instantiated with `.read(repo)`

Test Plan:
Ran tests using appropriate hg (release)

  11/30 17:35 cdelahousse@dev4253 ~/local/fb-hgext/tests
  $ ./run-tests.py test-morestatus.t --with-hg=~/facebook-hg-rpms/hg-crew/hg
  .
  # Ran 1 tests, 0 skipped, 0 warned, 0 failed.

Reviewers: #sourcecontrol, rmcelroy, ericsumner

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

Tasks: 9259195
2015-11-30 17:39:30 -08:00
Jun Wu
c01d6c54d9 Add interrupted update state to morestatus
Summary: People complain that `hg status` won't tell them if the repo is in a interrupted update state. This diff adds it.

Test Plan:
1. `cd` to some big project
2. Pick a random old revision from `hg log`, say `fdaa3224d9bd`.
3. `hg update fdaa3224d9bd`
4. Shortly after, in another terminal, `pkill -9 hg`
5. Check `hg status` will print:

```
# The repository is in an unfinished *update* state.
# To continue:                hg update fdaa3224d9bd
# To abort:                   hg update .
```

Also run `run-tests.py test-morestatus.t`.

Reviewers: #sourcecontrol, rmcelroy

Reviewed By: rmcelroy

Subscribers: durham, pyd, cdelahousse, lcharignon

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

Tasks: 9200036

Signature: t1:2691730:1448496639:135542e2698e44a824debd74d6393b98cc74e014
2015-11-27 05:16:53 -08:00
Christian Delahousse
165bf7ee63 morestatus: make morestatus not rely on mergestate for merge state
Summary:
The extra check for clean merge vs conflicted merge isn't needed. They both have
two parents

Test Plan: Ran the tests.

Reviewers: rmcelroy, #sourcecontrol, durham

Reviewed By: durham

Subscribers: michalburger1

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

Tasks: 8867673

Signature: t1:2587459:1445982486:0b7515558e2d57d4f0a949641b846036f82ec1e0
2015-10-27 14:48:34 -07:00
Christian Delahousse
93ef580a25 morestatus: include clean merge state, refactor state detection
Summary:
I was mostly taking into consideration conflicted states when I wrote this
extension. That means that a repo could be in a clean merge state, that is,
where the working copy has two parents and no conflicted files, and morestatus
wouldn't display it's extra status output.

Test Plan: See new test

Reviewers: #sourcecontrol, durham

Reviewed By: durham

Subscribers: akushner

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

Tasks: 8802101

Signature: t1:2567597:1445468752:429a63dda5a7269841aee16631049b937c13360e
2015-10-21 15:20:24 -07:00
Christian Delahousse
70b85f9c12 [morestatus] add helpful message to status when in bisect
Summary:
A continuation D2502125. Add more helpful output to hg status when the user is
in a bisect state.

Example output


  10/07 17:43 cdelahousse@dev4253 ~/local/clearmereg/testrepos/states/bisect
  $ hg status

  # The repository is in an unfinished *bisect* state.
  # To mark the commit good:       hg bisect --good
  # To mark the commit bad:        hg bisect --bad
  # To abort:                      hg bisect --reset

Test Plan: Tests have been updated

Reviewers: #sourcecontrol, durham

Reviewed By: durham

Subscribers: akushner

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

Tasks: 8563305

Signature: t1:2520493:1444288081:5da20016aaaaff77db24ecb01c404b0e11aeeb7a
2015-10-07 17:40:42 -07:00
Christian Delahousse
b5ee3f4aed [morestatus] messages in status for histedit, graft, unshelve, merge states
Summary:
Continuation of D2502125. Let's help people when they're in a wierd states by
displaying a helpful message below the output of `hg status`

Example output:
  10/07 16:53 cdelahousse@dev4253 ~/local/clearmereg/testrepos/states/merge
  $ hg status
  M a

  # The repository is in an unfinished *merge* state.
  # Unresolved merge conflicts:
  #
  #     a
  #
  # To mark files as resolved:  hg resolve --mark FILE
  # To continue:                hg commit
  # To abort:                   hg update --clean .

For more example output, see the tests

Test Plan: See tests: `tests/test-morestatus.t`

Reviewers: #sourcecontrol, durham

Reviewed By: durham

Subscribers: akushner

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

Tasks: 8563305

Signature: t1:2520272:1444287977:b90b747538754ef4f4f0f8fab3e56f3aa288d3e5
2015-10-07 17:03:17 -07:00
Christian Delahousse
4b30d6677c [morestatus] more helpful status for rebase
Summary:
If a user gets stuck in a stopped rebase, give some details to the user when
they run `hg status` about how to move forward.

Let's see if we can get some bike shedding done on one command.

Notes on behaviour:
* it there exists any unresolved conflicts, no matter, they'll be shown.
* there is no way to only show what state the user is in (and not the conflicts). You either turn more status on or off.

Example for rebase:

  10/05 19:34 cdelahousse@dev4253 ~/local/clearmereg/testrepos/states/rebasestate
  $ hg status
  M a

  # The repository is in an unfinished *rebase* state.
  # Unresolved merge conflicts:
  #
  #     a
  #
  # To mark files as resolved:  hg resolve --mark FILE
  # To continue:                hg rebase --continue
  # To abort:                   hg rebase --abort


Repo in rebase state after the all files have been resolved:

  $ hg status
  M a

  # The repository is in an unfinished *rebase* state.
  # No unresolved merge conflicts
  # To continue:                hg rebase --continue
  # To abort:                   hg rebase --abort

Test Plan: See tests

Reviewers: #sourcecontrol, rmcelroy, durham

Reviewed By: durham

Subscribers: dancol, pyd, akushner

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

Tasks: 8563305

Signature: t1:2502125:1444189728:d6abf28f09bcc0360628497db8d896025967827f
2015-10-01 21:24:43 -07:00
Christian Delahousse
cc9035e370 [status] Make status show what state the repo is in
Summary:
This is an MVP to give the user more information about the state of the repo. We'll grow the functionality in other diffs.

 for example, if the repo is in a state after a stalled graft, then hg status outputs a bit more

  $ hg status
   M a
   ? a.orig
   # The repository is in an unfinished graft state.

Test Plan: See the tests.

Reviewers: #sourcecontrol, durham, rmcelroy

Subscribers: akushner, rmcelroy

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

Tasks: 8563305
2015-10-01 20:17:28 -07:00