Commit Graph

5938 Commits

Author SHA1 Message Date
Pierre-Yves David
8f0998647c win32text: directly use repo.vfs.join
The 'repo.join' method is about to be deprecated.
2017-03-08 16:52:57 -08:00
Pierre-Yves David
9b498a89e0 transplant: directly use repo.vfs.join
The 'repo.join' method is about to be deprecated.
2017-03-08 16:52:49 -08:00
Pierre-Yves David
58d5f4561c shelve: directly use repo.vfs.join
The 'repo.join' method is about to be deprecated.
2017-03-08 16:52:42 -08:00
Pierre-Yves David
e3931f15fb share: directly use repo.vfs.join
The 'repo.join' method is about to be deprecated.
2017-03-08 16:52:30 -08:00
Pierre-Yves David
ec94f0410e mq: directly use repo.vfs.join
The 'repo.join' method is about to be deprecated.
2017-03-08 16:52:16 -08:00
Pierre-Yves David
91ebfa657f largefiles: directly use repo.vfs.join
The 'repo.join' method is about to be deprecated.
2017-03-08 16:52:06 -08:00
Pierre-Yves David
3f8c57e798 keyword: directly use repo.vfs.join
The 'repo.join' method is about to be deprecated.
2017-03-08 16:51:57 -08:00
Pierre-Yves David
3cf7472262 journal: directly use repo.vfs.join
The 'repo.join' method is about to be deprecated.
2017-03-08 16:51:49 -08:00
Pierre-Yves David
a1d4a95c88 histedit: directly use repo.vfs.join
The 'repo.join' method is about to be deprecated.
2017-03-08 16:51:43 -08:00
Pierre-Yves David
d781ee1c04 eol: directly use repo.vfs.join
The 'repo.join' method is about to be deprecated.
2017-03-08 16:51:36 -08:00
Pierre-Yves David
db602f5625 convert: directly use repo.vfs.join
The 'repo.join' method is about to be deprecated.
2017-03-08 16:51:25 -08:00
Mads Kiilerich
30045d0a29 vfs: use repo.vfs.rename 2017-03-11 11:04:14 -08:00
Mads Kiilerich
975c19c195 vfs: use repo.vfs.unlinkpath 2017-03-11 11:02:25 -08:00
Mads Kiilerich
a936a7f3a7 vfs: use repo.wvfs.unlinkpath 2015-01-14 01:15:26 +01:00
Martin von Zweigbergk
ef133769b3 rebase: abort if *any* commit in rebase set is public 2017-03-11 10:35:44 -08:00
Martin von Zweigbergk
df689070f8 rebase: unhide original working directory node as well (issue5219)
By including the working directory revision at the start of rebase in
the repo._rebaseset, we make sure it's not hidden when we update back
to it at the end of the rebase.

This feels like abusing the set a bit given its name (_rebaseset), but
I couldn't think of another name that's clearly better.
2017-03-10 23:07:20 -08:00
Martin von Zweigbergk
44ffe12623 rebase: pass in a regular set to _setrebasesetvisibility()
Trivial refactoring to simplify the next patch.
2017-03-10 23:06:31 -08:00
Yuya Nishihara
df15429e29 schemes: use br'' literal to define bytes regexp 2017-03-09 19:41:40 -08:00
Pierre-Yves David
1211038425 vfs: use 'vfs' module directly in 'hgext.largefile'
Now that the 'vfs' classes moved in their own module, lets use the new module
directly. We update code iteratively to help with possible bisect needs in the
future.
2017-03-02 13:32:27 +01:00
Pierre-Yves David
f3a174150b vfs: use 'vfs' module directly in 'hgext.convert'
Now that the 'vfs' classes moved in their own module, lets use the new module
directly. We update code iteratively to help with possible bisect needs in the
future.
2017-03-02 13:32:14 +01:00
Pierre-Yves David
2e94eebbe6 vfs: use 'vfs' module directly in 'hgext.transplant'
Now that the 'vfs' classes moved in their own module, lets use the new module
directly. We update code iteratively to help with possible bisect needs in the
future.
2017-03-02 13:31:39 +01:00
Pierre-Yves David
1be66dee7d vfs: use 'vfs' module directly in 'hgext.shelve'
Now that the 'vfs' classes moved in their own module, lets use the new module
directly. We update code iteratively to help with possible bisect needs in the
future.
2017-03-02 13:31:32 +01:00
Pierre-Yves David
485053e2a1 vfs: use 'vfs' module directly in 'hgext.mq'
Now that the 'vfs' classes moved in their own module, lets use the new module
directly. We update code iteratively to help with possible bisect needs in the
future.
2017-03-02 13:31:23 +01:00
Durham Goode
dbb351335e rebase: move actual rebase into a single transaction
Previously, rebasing would open several transaction over the course of rebasing
several commits. Opening a transaction can have notable overhead (like copying
the dirstate) which can add up when rebasing many commits.

This patch adds a single large transaction around the actual commit rebase
operation, with a catch for intervention which serializes the current state if
we need to drop back to the terminal for user intervention. Amazingly, almost
all the tests seem to pass.

On large repos with large working copies, this can speed up rebasing 7 commits
by 25%. I'd expect the percentage to be a bit larger for rebasing even more
commits.

There are minor test changes because we're rolling back the entire transaction
during unexpected exceptions instead of just stopping mid-rebase, so there's no
more backup bundle. It also leave an unknown file in the working copy, since our
clean up 'hg update' doesn't delete unknown files.
2017-03-07 16:27:32 -08:00
Durham Goode
defe69adff rebase: allow aborting if last-message.txt is missing
Previously, if .hg/rebasestate existed but .hg/last-message.txt was missing, 'hg
rebase --abort' would say there's no rebase in progress but 'hg checkout foo'
would say 'abort: rebase in progress'. It turns out loading the collapse message
will throw a "no rebase in progress" error if the file doesn't exist, even
though .hg/rebasestate obviously indicates a rebase is in progress.

The fix is to only throw an exception if we're trying to --continue, and to just
eat the issues if we're doing --abort.

This issue is exposed by us writing the rebase state earlier in the process.
This will be used by later patches to ensure the user can appropriately 'hg
rebase --abort' if there's a crash before the first the first commit has
finished rebasing. Tests cover all of this. The only negative affect is we now
require a hg rebase --abort in a very specific exception case, as shown in the
test.
2017-03-07 16:30:31 -08:00
Durham Goode
f08a205c47 rebase: add storestatus support for transactions
This let's the status writing logic support transactions. This will be useful in
a later patch where we add a transaction around the entire rebase.
2017-03-07 14:04:29 -08:00
Durham Goode
a8f314881e rebase: move storestatus onto rebaseruntime
The rebaseruntime class already has the restorestatus function, so let's make it
own the store status function too. This get's rid of a lot of unnecessary
argument passing and will make a future patch cleaner that refactors storestatus
to support transactions.
2017-03-07 14:11:44 -08:00
Durham Goode
a4583d843e rebase: clear updatestate during rebase --abort in more cases
Previously, rebase --abort would only call update if you were on a node that had
already been rebased. This meant that if the rebase failed during the rebase of
the first commit, the working copy would be left dirty (with a .hg/updatestate
file) and rebase --abort would not have update to clean it up.

The fix is to also perform an update if you're still on the target node or on
the original working copy node (since the working copy may be dirty, we still
need to do the update). We don't want to perform an update in all cases though
because of issue4009.

A subsequent patch makes this case much more common, since it causes the entire
rebase transaction to rollback during unexpected exceptions. This causes the
existing test-rebase-abort.t to cover this case.
2017-03-07 14:19:08 -08:00
Pierre-Yves David
e5cb48ac36 vfs: replace 'scmutil.opener' usage with 'scmutil.vfs'
The 'vfs' class is the first class citizen for years. We remove all usages of
the older API. This will let us remove the old API eventually.
2017-03-02 03:52:36 +01:00
Durham Goode
f3dc8f389b fsmonitor: remove use of repo.opener
This has been deprecated, so we need to switch to the appropriate vfs apis.
2017-03-07 12:52:00 -08:00
Yuya Nishihara
bef32f9011 share: drop 'relshared' requirement as well 2017-03-03 00:11:51 +09:00
Yuya Nishihara
42f38a34a0 share: fix typo to drop 'shared' requirement on unshare
This must be a typo and it seems correct to drop the requirement since the
repo is no longer a shared repository.
2017-03-03 00:11:18 +09:00
Simon Farnsworth
cd8b635c8b hgk: set a blocked tag when the user invokes view 2017-03-06 03:27:52 -08:00
Simon Farnsworth
947a0b6d19 transplant: set a blockedtag when invoking external filter 2017-03-06 03:27:41 -08:00
Yuya Nishihara
5fab4a9d55 patchbomb: add config knob to generate flags by template (issue5354)
This can be used to flag patches by branch or topic automatically. Flags
optionally given by --flag option are exported as {flags} template keyword,
so you can add --flag V2.
2017-02-25 18:41:00 +09:00
Yuya Nishihara
7697dd4d5b patchbomb: pass around ui and revs that are needed for flag template
See the next patch for why.
2017-02-25 18:35:34 +09:00
Yuya Nishihara
cc7b1af6b2 patchbomb: build patch texts by _getpatchmsgs()
Now _getpatchmsgs() knows revision numbers, which allows us to generate flags
by applying a template to changectx objects.
2017-02-25 18:28:04 +09:00
Yuya Nishihara
2fae5e032d patchbomb: drop internal option for pbranch extension (API)
I want to move _getpatches() to _getpatchmsgs() to make sure each patch text
is tied with the corresponding revision number. This helps adding templater
support.

IIRC, the pbranch extension doesn't work with the recent Mercurial versions,
so the removal of this option wouldn't hurt.
2017-02-25 18:25:17 +09:00
Yuya Nishihara
be15dfae52 patchbomb: factor out function that builds a prefix string to patch subject
I'll add templating support.
2017-02-25 18:16:41 +09:00
Augie Fackler
3322b24b9d schemes: move re construction to module-level and python3-ify
This makes the schemes extension load correctly in Python 3.
2017-03-03 13:25:30 -05:00
Pierre-Yves David
1be9d3fb99 clonebundle: use 'repo.vfs' instead of 'repo.opener'
The later is a 5 years old form.
2017-03-02 03:23:18 +01:00
Dan Villiom Podlaski Christiansen
66c3976319 share: add --relative flag to store a relative path to the source
Storing a relative path the source repository is useful when exporting
repositories over the network or when they're located on external
drives where the mountpoint isn't always fixed.

Currently, Mercurial interprets paths in `.hg/shared` relative to
$PWD. I suspect this is very much unintentional, and you have to
manually edit `.hg/shared` in order to trigger this behaviour.

However, on the off chance that someone might rely on it, I added a
new capability called 'relshared'. In addition, this makes earlier
versions of Mercurial fail with a graceful error.

I should note that I haven't tested this patch on Windows.
2017-02-13 14:05:24 +01:00
Pierre-Yves David
a29094b506 color: update main documentation
Now that the feature no longer lives in the extension, we document it in the
help of the core config. This include the new 'ui.color' option introduced in
the previous changesets.

As a result the color extensions can now be deprecated.

This is a documentation patch only; color is still disabled by default.
2017-02-21 20:04:55 +01:00
Pierre-Yves David
677892a9d7 pager: drop the 'color' dependant code
The 'color' implementation is in core and no longer wrap '_runcommand'. We drop
the extra complexity.
2017-02-28 20:12:08 +01:00
Pierre-Yves David
394a984c5e color: move 'debugcolor' into the 'debugcommands' modules
This is the last bits we needed to move out of the extensions. 'hgext/color.py'
now only contains logic to changes the default color behavior to 'auto'.

However, more cleanups are on the way and we need to document the new config
directly in core.
2017-02-21 18:41:37 +01:00
Martin von Zweigbergk
ef59d7b1fd merge with stable 2017-02-28 11:13:25 -08:00
eloimorlaas
293313403e record: update help to describe ui.interface
hg help record was not accurate if using another interface than the text one
2017-02-23 11:23:17 -08:00
Sean Farley
e145fc2df7 ui: rename tmpdir parameter to more specific repopath
This was requested by Augie and I agree that repopath is more
descriptive.
2017-01-18 18:25:51 -08:00
Yuya Nishihara
9979640f1d pager: wrap _runcommand() no matter if stdout is redirected
We've made chg utilize the common code path implemented in pager.py (by
e8fb65f5e551 and e97133c7a9dc), but the chg server does not always start
with a tty. Because of this, uisetup() of the pager extension could be
skipped on the chg server.

Kudos given to Sean Farley for dogfooding new chg and spotting this problem.
2017-01-19 23:01:32 +09:00
Kostia Balytskyi
bc104f588e shelve: make unshelve not crash when there are missing files (issue4176)
This patch makes it possible to unshelve while having missing files
in your repo as long as shelved changes don't touch those missing files.
It also makes error message better otherwise.
2017-01-19 09:48:40 -08:00