Commit Graph

132 Commits

Author SHA1 Message Date
Lucas Moscovicz
e0f8aa1f35 hgext: updated extensions to return a baseset when adding symbols 2014-02-11 09:00:38 -08:00
FUJIWARA Katsunori
636302d19b transplant: use "ui.extractchoices()" to show the list of available responses
Before this patch, transplant extension shows the list of available
responses by specific string, even though the prompt string passed to
"ui.promptchoice()" has enough (maybe i18n-ed) information.

This patch uses "ui.extractchoices()" to show the list of available
responses.
2013-12-02 00:50:30 +09:00
FUJIWARA Katsunori
ecea0f8fc0 transplant: use "ui.promptchoice()" for interactive transplant
Before this patch, transplant extension uses "ui.prompt()" for
interactive transplant, and has to check whether user response
returned by "ui.prompt()" is valid or not in own code.

In addition to it, transplant extension uses response characters
(e.g. "y", "n", and so on) directly in own code, and this disallows to
use another response characters by translation, even though the help
shown by '?'  typing is translatable.

This patch uses "ui.promptchoice()" instead of "ui.prompt()" to
resolve problems above.
2013-12-02 00:50:30 +09:00
FUJIWARA Katsunori
90dd1201ec transplant: use peer of source repository as "remote" for "repo.pull()"
Before this patch, transplant with "--merge" option fails with
traceback unexpectedly, if it causes pull from the source repository
on the local host.

"discovery.findcommonincoming()" invokes "capable()" method on the
object given from "localrepository.pull()", but it is
"localrepository" object in this case and doesn't have such method.

This patch uses peer object of source repository as "remote" argument
for "localrepository.pull()" invocation like other invocations of it
in transplant.py.
2013-11-16 23:14:20 +09:00
Mads Kiilerich
eabc047878 spelling: random spell checker fixes 2013-10-24 01:49:56 +08:00
Matt Mackall
6d0d30f28a checkunfinished: accommodate histedit quirk
Turns out histedit actually intends for commits (but not other
operations like update) to be possible during its operation.
2013-07-25 02:17:52 -05:00
Matt Mackall
d033919984 transplant: add checkunfinished (issue3955)
Nobody loves transplant anymore, but it was the first command to have
a --continue flag.
2013-07-24 23:51:44 -05:00
Mads Kiilerich
498a388ae4 transplant: use set for prune lookup 2013-04-16 19:31:59 +02:00
Mads Kiilerich
4abe784ebb transplant: improve documentation 2013-04-16 19:20:23 +02:00
Mads Kiilerich
c4edbe5043 transplant: clarify what --branch do - it has nothing to do with branches
--branch specifies heads and has nothing to do with named branches, and it only
deals with topological branches to the same extent as all other DAG operations
do.
2013-04-16 19:18:38 +02:00
Bryan O'Sullivan
747f253c06 transplant: pass source through to recover 2013-04-12 18:44:22 -07:00
Bryan O'Sullivan
6bdbf1a461 repoview: remove unreachable code
Found using Cython.
2013-04-12 17:18:52 -07:00
Siddharth Agarwal
7a2f9d28dd transplant: replace incancestors uses with ancestors 2012-12-17 15:08:06 -08:00
Simon Heimberg
6523213f0e peer: subrepo isolation, pass repo instead of repo.ui to hg.peer
Do not pass ui because it contains the configuration of the repo. It is the
same object as repo.ui.
When a repo is passed to hg.peer, the global configuration is read from
repo.baseui.
2012-07-28 23:28:36 +02:00
Patrick Mezard
4da0fafc00 transplant: fix emptied changeset message
- Append an EOL
- State the changeset is skipped
2012-08-01 14:08:19 +02:00
Patrick Mezard
ba210ae123 transplant: handle non-empty patches doing nothing (issue2806)
If patch.patch() reports patched files when applying a changeset and the
following commit says nothing changed, transplant used to abort with a
RuntimeError, assuming something went wrong with patching.

The mismatch is patch.patch() reports patched files, not changed ones.
It could be modified to report changed files but it means duplicating
work from status, may be expensive in the case of binary files, and is
probably not that useful at API level. For instance, if two patches are
applied on the working directory, the outcome may be nothing changed
while each call would have returned modified files. The caller would
have to call status() itself again.

This patch fixes the issue by trusting patching code: if the patch
succeeded and commit reports nothing changed, then nothing changed,
patch() did not "dropped changes on the floor".
2012-07-31 17:39:32 +02:00
Mads Kiilerich
688b9e2048 check-code: indent 4 spaces in py files 2012-07-31 03:30:42 +02:00
Sune Foldager
ffe56435bf peer: introduce peer methods to prepare for peer classes
This introduces a peer method into all repository classes, which currently
simply returns self. It also changes hg.repository so it now raises an
exception if the supplied paths does not resolve to a localrepo or descendant.

Finally, all call sites are changed to use the peer and local methods as
appropriate, where peer is used whenever the code is dealing with a remote
repository (even if it's on local disk).
2012-07-13 21:46:53 +02:00
Joshua Redstone
b7543298c7 transplant: convert applied() algorithm from nodes to revs
After a recent switch from revlog.reachable to revlog.ancestors,
clean up the code a bit to use revs rather than nodes.
2012-06-08 14:21:32 -07:00
Joshua Redstone
09130c5cf2 revlog: remove reachable and switch call sites to ancestors
This change does a trivial conversion of callsites to ancestors.
Followon diffs will switch the callsites over to revs.
2012-06-08 08:39:44 -07:00
Thomas Arendsen Hein
0e93bb1709 consistency: use REV instead of REVISION 2012-06-20 16:49:04 +02:00
Augie Fackler
96d44b39f7 hgext: mark all first-party extensions as such 2012-05-15 14:37:49 -05:00
Levi Bard
23f20d7bd7 transplant: manually transplant pullable changesets with --log 2012-05-11 17:26:58 +02:00
Patrick Mezard
2c65c226cf localrepo: add setparents() to adjust dirstate copies (issue3407)
The fix introduced in 3509b9cf8f86 was only partially successful. It is correct
to turn dirstate 'm' merge records into normal/dirty ones but copy records are
lost in the process. To adjust them as well, we need to look in the first
parent manifest to know which files were added and preserve only related
records. But the dirstate does not have access to changesets, the logic has to
moved at another level, in localrepo.
2012-04-29 22:25:55 +02:00
Patrick Mezard
7ca23e70fa transplant: do not rollback on patching error (issue3379)
Otherwise, all transplanted revisions are gone and the failing one cannot be
fixed (unless it is the first one).

I do not know what is the expected behaviour with rollback, probably something
pull-like. Non-conflicting cases should work as previously. But something like:

  $ hg transplant r1 r2
  commiting r1 as c1
  failing r2
  $ hg transplant --continue
  committing r2 as c2
  $ hg rollback

would reset the repository to its state before the "transplant --continue"
instead of the whole transplant session. To fix this we might need a way to
open an existing journal file, not sure this is worth the pain.
2012-04-22 16:40:38 +02:00
Steven Stallion
ac3686e8e8 transplant: remove extraneous whitespace 2012-04-16 22:41:03 -07:00
Steven Stallion
4915686ba1 transplant: permit merge changesets via --parent
This change permits the transplant extension to operate on merge
changesets by way of --parent.  This is particularly useful for
workflows which cherrypick branch merges rather than each commit
within a branch.
2012-04-10 23:24:12 -07:00
Matt Mackall
43ea79b7dc transplant: add --edit option 2011-10-10 23:07:09 -05:00
Greg Ward
aac3e5d5ea transplant: wrap a transaction around the whole command 2011-10-04 19:43:45 -04:00
Idan Kamara
dedd139496 transplant: use ui out descriptor when calling util.system 2011-06-24 19:27:53 +03:00
Patrick Mezard
6aaca90508 patch: turn patch() touched files dict into a set 2011-06-11 14:14:11 +02:00
Matt Mackall
efecb99535 hg: change various repository() users to use peer() where appropriate
This gets all the easy cases (peers that aren't also used as repositories).
2011-06-10 11:43:38 -05:00
Matt Mackall
66805ccfed revlog: stop exporting node.short 2011-05-21 15:01:28 -05:00
Patrick Mezard
78738c3822 patch: remove patch.patch() cwd argument 2011-05-19 22:44:01 +02:00
Matt Mackall
cf07129983 scmutil: move revsingle/pair/range from cmdutil
This allows users at levels below the command layer to avoid import loops.
2011-05-13 14:06:28 -05:00
Adrian Buehlmann
846e72e877 transplant: use cmdutil.command decorator 2011-05-12 17:50:07 +02:00
Patrick Mezard
e0378ee5bd patch: make patch()/internalpatch() always update the dirstate 2011-05-08 17:48:31 +02:00
Patrick Mezard
88e958194e patch: move updatedir() from cmdutil into patch
Also, create an artificial wdutil.py to avoid import cycles between patch.py
and cmdutil.py.
2011-05-08 17:48:30 +02:00
Matt Mackall
2f01bc4c58 merge with stable 2011-05-06 11:51:18 -05:00
Idan Kamara
353dfef2b7 transplant: remove unneeded loop over repo in revset 2011-05-06 16:00:48 +03:00
Idan Kamara
9afabe8fdd transplant: fix revset doc 2011-05-06 15:37:38 +03:00
Martin Geisler
390c2e4c55 transplant: avoid the word "rebase" when we mean "transplant" 2011-03-13 12:44:35 +01:00
Martin Geisler
459f5e46b7 transplant: explain that changesets are copied, not moved 2011-03-13 12:43:52 +01:00
Dan Villiom Podlaski Christiansen
511c941422 prevent transient leaks of file handle by using new helper functions
These leaks may occur in environments that don't employ a reference
counting GC, i.e. PyPy.

This implies:
 - changing opener(...).read() calls to opener.read(...)
 - changing opener(...).write() calls to opener.write(...)
 - changing open(...).read(...) to util.readfile(...)
 - changing open(...).write(...) to util.writefile(...)
2011-05-02 10:11:18 +02:00
Peter Arrenbrecht
66c54cef75 bundlerepo: fix and improve getremotechanges
Fixes the regression where incoming could show local changes
introduced by rev eecf03f0ef7c.
2011-05-02 12:36:23 +02:00
Peter Arrenbrecht
b867e650e6 discovery: drop findoutgoing and simplify findcommonincoming's api
This is a long desired cleanup and paves the way for new discovery.
To specify subsets for bundling changes, all code should use the heads
of the desired subset ("heads") and the heads of the common subset
("common") to be excluded from the bundled set. These can be used
revlog.findmissing instead of revlog.nodesbetween.

This fixes an actual bug exposed by the change in test-bundle-r.t
where we try to bundle a changeset while specifying that said changeset
is to be assumed already present in the target. This used to still
bundle the changeset. It no longer does. This is similar to the bugs
fixed by the recent switch to heads/common for incoming/pull.
2011-04-30 17:21:37 +02:00
Adrian Buehlmann
cf126bb7dd move opener from util to scmutil 2011-04-20 19:54:57 +02:00
Matt Mackall
a8dd64dcb0 misc: replace .parents()[0] with p1() 2011-04-04 16:21:59 -05:00
Brendan Cully
f05749f48c Fix transplant error message to correspond with test 2011-03-28 21:36:29 -07:00
Luke Plant
bd1d8463c8 transplant: fix crash if filter script munges log file
This fixes an UnboundLocalError crash if the filter script removes the
'User' or 'Date' lines from the log file.
2011-03-28 21:17:32 +01:00