Commit Graph

29 Commits

Author SHA1 Message Date
Pierre-Yves David
b5902fafde test: add a very basic test for fb-amend
The next changeset will make some change to fbamend. I'm introducting a
minimalist test to be able to test the change.
2014-06-12 17:53:50 -07:00
Pierre-Yves David
ab68fa3ea3 smartlog: simplify the coloration code with a list compression
Shorte, easier to read.
2014-06-10 16:53:53 -07:00
Pierre-Yves David
ad5b4b4916 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
840e36d875 gitlookup: use BundleValueError instead of UnknownPartError
The exception have been renamed and moved into the ``mercurial.error`` module in
mercurial core.
2014-06-04 17:17:15 -07:00
Siddharth Agarwal
08584add27 actually build gitlookup 2014-05-23 14:39:33 -07:00
Siddharth Agarwal
5322d7b6fe add a command and server-side support to fetch git metadata
Summary:
When a machine is newly set up, it needs to have the git mapfile available. Generating it from scratch is prohibitively slow for large repos like `configerator`, so instead add a command that can download the entire git metadata from a server that has it.

This is a temporary hack while I work on a real fix to upstream to hg-git. A real fix would be

- part of hg-git
- not send the entire git metadata over, just the bits that are needed based on a common/heads computation
- be dependent on bundle2
- (probably) be part of the pull operation, not a separate command
- be configurable with an option

This isn't part of hg-git, even in a private branch, to emphasize its temporary nature. `gitlookup` might also not be the best fit, but I want to avoid adding yet another extension for a temporary hack.

Test Plan:
Ran the following commands. Note that the current version of `hg` deployed to devservers is broken, so we need to deploy an updated hg before enabling this. These commands were tested against 1ced7c762592

(in `fbandroid-hg`, with `gitlookup` enabled on both ends and the remotefilelog fix in D1341059)

    hg gitgetmeta ../fbandroid-from-git

Saw that 3 files were written out.

    hg gitgetmeta ssh://localhost//data/users/sid0/fbandroid-from-git

Saw that 3 files were written out.

Reviewers: dschleimer, davidsp, akushner, durham, pyd

Reviewed By: pyd

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

Tasks: 3751836
2014-05-20 22:32:54 -07:00
Siddharth Agarwal
cdda6c15f8 add an extension that allows server-side hg->git and git->hg lookups
Summary:
This is a massive hack until Dewey becomes capable of answering these questions.

The plan is to use these commands in `arc diff` and `arc patch` to send the Git versions of the base commit over, so that the diff and land infra reaches parity with Git.

This should also unblock configerator-hg and allow the landing strip to work.

Test Plan:
In my `fbandroid-from-git` repo, enabled this extension, and then added the config:

```
[gitlookup]
mapfile = git-mapfile
```

Then, ran

```
hg id -r _gitlookup_hg_1fe73e73af4acadf1865a41e3aaa518a70cc2302 ssh://localhost//data/users/sid0/fbandroid-from-git -i --debug
```

Saw that the last line printed out was `76327beadc98c7c0559cd8aa36f0a25d93d781a5`, the Git equivalent of that commit.

After this, ran

```
hg id -r _gitlookup_git_76327beadc98c7c0559cd8aa36f0a25d93d781a5 ssh://localhost/data/users/sid0/fbandroid-from-git -i --debug
```

Saw that the last line printed out was `1fe73e73af4acadf1865a41e3aaa518a70cc2302`, as expected.

Reviewers: dschleimer, akushner, davidsp, pyd, mpm, durham

Reviewed By: durham

Subscribers: pradvenkat, akshay, thawan

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

Tasks: 3751836
2014-05-14 16:17:25 -07:00
Siddharth Agarwal
6b475e55a4 merge branches 2014-05-15 12:38:28 -07:00
Pierre-Yves David
fbd8c16dac githelp: properly abort on unknown command
Summary: We previously aborted with a KeyError traceback.

Test Plan: Run that thing with an unknown command, got a clear abort

Reviewers: durham

Differential Revision: https://phabricator.fb.com/D1299542
2014-04-28 12:51:23 -07:00
Durham Goode
02033526d4 Fix hg commit -l when using fbamend
A change in core mercurial added --edit to the commit options. This conflicted
with the fbamend --edit, which caused hg commit --amend -l foo.txt to actually
open the editor. Breaking arc diff.
2014-04-25 17:13:13 -07:00
Pierre-Yves David
f7a8458257 backups: compatibility with Mercurial 3.0 2014-04-25 11:21:34 -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
c030cd9d54 Fix hg githelp without args 2014-03-10 16:02:24 -07:00
Durham Goode
8bd405d4df Fix hg backups message 2014-03-06 10:36:25 -08:00
Durham Goode
81ca4d4e44 Add hg backups command for easier backup bundle discovery
Summary:
Adds an 'hg backups' command that lists the commits in the backup
bundles, newest first. It also allows 'hg backups --recover <commit hash>' which will then
recover the commit from the appropriate backup bundle.

The default output looks like so: https://www.facebook.com/pxlcld/l0gC

Test Plan: Ran it.  See the screenshot

Reviewers: mpm, sid0, dschleimer, pyd, davidsp

Differential Revision: https://phabricator.fb.com/D1183032
2014-02-20 13:34:57 -08:00
Durham Goode
9d03f3b36c Add 'hg githelp' command
Summary:
Adds an 'hg githelp' command that translates git commands into Mercurial
commands.

Test Plan:
$ hg githelp -- rebase origin/master
hg rebase -d master

$ hg githelp -- checkout -B foo
hg bookmark foo

$ hg git -- checkout -B foo master
hg update master && hg bookmark foo

$ hg git -- reset --soft HEAD^
note: hg strip -k will delete the commit, but keep the changes in your working copy.

hg strip -k -r .

Reviewers: mpm, dschleimer, sid0, pyd, davidsp

CC: akushner

Differential Revision: https://phabricator.fb.com/D1184289
2014-02-20 20:54:17 -08:00
Pierre-Yves David
b24e20f14b add the crecord extension to the list of installed extension.
The crecord extension is a nice ncurse version of record that allow you to
interactively select changes to include from files to line level.
2013-12-18 17:43:19 -08:00
David Soria Parra
790e43474a Use a processgroup to ensure all arc subprocesses are properly killed
Summary:
phrevset can hang when the revwalk already returns a rev but
the parallel arc call didn't finish with arc having subprocesses running.
This will result in hg log showing output but hanging for a quiet a bit.
We have to use a processgroup and make arc the leader of it to kill
all it's subprocesses properly. Note this will make it incompatible
with windows.

Test Plan:
Tested locally and ensured that a differential revision is
found and we abort nicely.

Reviewers: durham

Reviewed By: durham

Differential Revision: https://phabricator.fb.com/D1096568
2013-12-12 14:49:04 -08:00
Durham Goode
143e90ccdd Add phrevset to make file 2013-12-04 18:47:56 -08:00
Delyan Kratunov
95f6d97e12 [hg] Add support for Differential revsets
Summary:
Add the ability to issue commands like

  hg log -r D12345

Supports already shipped commits (by parsing the SVN rev number and delegating to hgsubversion), as well as mercurial commits in various states

Test Plan:
Easier to show than tell:

  [delyank@dev1436 ~/www] arc feature test_diff_revset
  [delyank@dev1436 ~/www] echo "Don't commit me" > dontcommit.test
  [delyank@dev1436 ~/www] hg add dontcommit.test
  [delyank@dev1436 ~/www] hg commit -m "[test] Test commit"
  [delyank@dev1436 ~/www] arc diff
  [...]
  Created a new Differential revision:
          Revision URI: https://phabricator.fb.com/D1055569
  [...]

  [delyank@dev1436 ~/www] hg log --debug -r D1055569
  [diffrev] Getting diff from Conduit..done
  [diffrev] VCS is hg
  changeset:   587735:82d4de66e17bb3b92fe15df4eda8b8420b7ed074
  bookmark:    test_diff_revset
  tag:         tip
  phase:       draft
  [...]
  description:
  [test] Playing with conduit, don't commit
  [...]
  Differential Revision: https://phabricator.fb.com/D1055569

  [delyank@dev1436 ~/www] echo "No, really, don't" >> dontcommit.test
  [delyank@dev1436 ~/www] hg amend # change local hash
  [delyank@dev1436 ~/www] hg log --debug -r D1055569
  [diffrev] Getting diff from Conduit..done
  [diffrev] VCS is hg
  [diffrev] Traversing log for 1055569
  changeset:   587735:48565d21a43f730aa3b9cebccbb47fa406df557b
  bookmark:    test_diff_revset
  tag:         tip
  phase:       draft
  [...]
  description:
  [test] Playing with conduit, don't commit
  [...]
  Differential Revision: https://phabricator.fb.com/D1055569

  [delyank@dev1436 ~/www] hg log --debug -r D1053132 # a diff that's already been shipped
  [diffrev] Getting diff from Conduit..done
  [diffrev] VCS is svn
  changeset:   586857:61a4036e89bafefaba4de2ebe1190db999a8915d
  [...]
  description:
  [hashtagbot] Add the #filetask hashtag to Task Creeper
  [...]
  Differential Revision: https://phabricator.fb.com/D1053132

Reviewers: sid0, davidsp

Reviewed By: davidsp

CC: jhunt, davidsp

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

Task ID: 3159944
2013-11-15 14:55:42 -08:00
Durham Goode
034fd17869 Fix --fixup when the children are already fixed 2013-09-10 19:26:13 -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
Durham Goode
1b3fc0b767 Disable smartlog colors in other log commands 2013-06-20 13:21:06 -07:00
Durham Goode
29a883af7c Rename package to fbhgext 2013-06-20 12:57:57 -07:00
Durham Goode
26387ef0c1 Initial commit: fbamend, smartlog 2013-06-20 12:16:36 -07:00