Commit Graph

14 Commits

Author SHA1 Message Date
Jing Qian
fa40278190 copy remote_bookmark reflog when sharing 2016-03-23 22:47:54 -07:00
Laurent Charignon
91cdf0b17d reflog: make the code check-code compliant
Summary:
This snuck in right after the patches for making the repo check-code
compliant and before we enabled check-code for the repo!

Test Plan: N/A

Reviewers: #sourcecontrol, ttung

Differential Revision: https://phabricator.fb.com/D2820166
2016-01-11 10:34:36 -08:00
Kostia Balytskyi
992ad11c72 reflog: made an argument optional for a wrapper function
Summary:
Wrapper function `recordremotebookmarks` has four required
arguments (one of them orig), original function has just two
required arguments. That means that when original function is
called with two arguments and is wrapped, there is going to be
an exception. This is exactly what happens when in a repo with
remotenames and reflog extensions `hg path -d name` is called.

Test Plan: -ran `hg paths -d pathname` and made sure that it works

Reviewers: durham, lcharignon

Subscribers: tienchai

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

Tasks: 8590151
2016-01-07 22:48:28 -08:00
Laurent Charignon
51a8884b12 cleanup: make reflog pass check-code
Summary: This will make it easier to move it into core

Test Plan: Tests are still passing

Reviewers: #sourcecontrol, ttung

Differential Revision: https://phabricator.fb.com/D2784492
2015-12-23 14:42:31 -08:00
Laurent Charignon
b4ae29f1d8 reflog: remove mutable default argument pattern
Summary:
Before this patch we were using {} as a default argument.
{} is mutable and would have leads to confusion if the function was to
be called multiple times.

Test Plan: Tests are passing

Reviewers: #sourcecontrol, ttung

Differential Revision: https://phabricator.fb.com/D2784485
2015-12-23 14:42:31 -08:00
Thu Trang Pham
5caca3efb1 Adding --commits to reflog
Summary: I decided to try a simple Mercurial task as part of hack49.

Test Plan: Added regression tests

Reviewers: lcharignon, ericsumner, mitrandir, pyd, akushner, rmcelroy, durham

Reviewed By: durham

Subscribers: cdelahousse, de-engagement-diffs@

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

Tasks: 8021459

Signature: t1:2614023:1447816107:e4c5422956f876716455feeb5a00b9a805cb6cb5
2015-11-17 19:03:28 -08:00
Durham Goode
410ca5052a reflog: fix devel-warn abotu dirstate.write 2015-10-26 17:51:36 -07:00
Christian Delahousse
980bc5ef4f reflogs: make reflog track remotebookmarks in remotenames
Test Plan: Added tests and ran them

Reviewers: #sourcecontrol, durham

Reviewed By: durham

Subscribers: durham

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

Tasks: 7526543

Signature: t1:2566135:1445487237:0ffec50e7cf23c5f3e06e147c59151e485602c2a
2015-10-21 11:45:32 -07:00
James Mills
75ccf5a2b8 revlog: Fix a TypeError with recorddirstateparents (missing tr in signature)
Summary: revlog: Fix a TypeError with recorddirstateparents (missing tr in signature)

Test Plan: Various hg commands don't bomb out

Reviewers: rmcelroy

Reviewed By: rmcelroy

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

Signature: t1:2556418:1445294251:4a61a6a03895e18fbec1cb600cceefcf524f76e6
2015-10-19 12:09:18 -07:00
Ryan McElroy
f19c04580a Merge fbonly into default
Summary:
A ton of tests in the 'default' branch are broken, yet they all work in 'fbonly' (because that's what we test and push).

Let's give the world all of our goodness. Bleeding edge is where it's at.

Top of hg sl now looks like:

```
@    386a20  rmcelroy
|\   merge fbonly into default
| |
o |  a284c7  rmcelroy  D1880107  remote/@
| |  githelp: add: mention that record and crecord make commits
| |
| o  f4870a  sid0  remote/fbtip  fbonly
| |  crecord: update to latest default
```

Test Plan: run-tests.py actually works now

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

Reviewed By: durham

Subscribers: lcharignon, mpm, ps

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

Signature: t1:1883891:1425613263:8c199f339596384aa7d089154ef99eb982ecff87
2015-03-08 12:22:25 -07:00
David Soria Parra
cddc80fd98 fb-hgext: add docstrings for extensions
Summary:
Most of our internal extensions don't have any docstringa causing hg help
to show nothing. I think this is confusing, as we teach people to use hg help.
In particular for our extensions they won't find anything on the internet
but hg help won't help either. So let's add rudimentary help texts.

Also ensure that gitnode is properly documented in hg help revset.

Test Plan:
added extensions, checked hg help and hg help extension. Also
checked hg help revset for gitnode.

Reviewers: rmcelroy, durham, sid0, akushner

Differential Revision: https://phabricator.fb.com/D1645964
2014-10-28 23:06:11 -07:00
Durham Goode
f0b8c47bad Set repo on dirstate for all instances
Summary:
The dirstate can be recreated throughout the lifetime of the process, so
setting dirstate.repo only at repo creation time was not enough.  Now we add it
by defining a new class.

Test Plan: Ran the tests

Reviewers: sid0

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

Tasks: 5401736
2014-10-20 17:13:04 -07:00
Durham Goode
5986c64daf Update reflog to work with upstream bookmark.write changes
Upstream no longer always uses bookmark.write to write.  Sometimes it goes
through the transaction API and uses bookmark._write. So now we wrap that
instead.

Also adds a test that would have caught this, since the existing commit/bookmark
tests did not exercise this new write path.
2014-10-14 17:23:09 -07:00
Durham Goode
bd577925d9 reflog: adds a reflog extension to fb-hgext
Summary:
This adds an extension that tracks the locations of the working copy and
bookmarks over time. It's still a proof of concept, but I want to get it
deployed to start getting feedback.

Running `hg reflog` by default shows the previous locations of the working
copy (most recent first).

  ~/myrepo> hg reflog
  Previous locations of '.':
  35a5fcfee452  rebase -d master
  32eee5e2d406  up .^
  b5d6dab4f900  up foo -C

Specifying a bookmark name shows the locations of that bookmark over time.

  ~/myrepo> hg reflog foo
  Previous locations of 'foo':
  d1a696044ec0  rebase -d master
  35a5fcfee452  rebase -d master
  32eee5e2d406  book foo -f

--verbose will show more information about each entry.

  ~/myrepo> hg reflog foo -v
  Previous locations of 'foo':
  35a5fcfee452 -> d1a696044ec0 durham   2014-10-01 18:32:14  rebase -d master
  32eee5e2d406 -> 35a5fcfee452 durham   2014-10-01 17:28:54  rebase -d master
  000000000000 -> 32eee5e2d406 durham   2014-10-01 17:28:30  book foo -f

It's currently stored as a single .hg/reflog file that is append only. Each
entry can store an arbitrary number of hashes (like storing 2 hashes for a merge
state working copy), which means we could also potentially use this to track
heads in branches as well.

It also (sorta) works with '-T json' for machine readable output:

  ~/myrepo> hg reflog foo -T json
  [
   {
    "command": "up .^",
    "date": "2014-10-02 13:54:45",
    "newhashes": "474ff61d1a36",
    "oldhashes": "d1a696044ec0",
    "user": "durham  "
   },
   {
    "command": "book foo",
  ...
  ]

Test Plan: Added tests. Ran them.

Reviewers: sid0, pyd, mpm, davidsp, akushner

Differential Revision: https://phabricator.fb.com/D1592875
2014-10-02 14:04:54 -07:00