Commit Graph

99 Commits

Author SHA1 Message Date
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
Martin Geisler
6a3d9310ab code style: prefer 'is' and 'is not' tests with singletons 2010-11-22 18:15:58 +01:00
Patrick Mezard
3fd83b5b68 hggettext: handle i18nfunctions declaration for docstrings translations 2010-10-24 12:52:37 +02:00
Patrick Mezard
bd120906a2 Fix and unify transplant and bookmarks revsets doc registration 2010-10-23 19:22:42 +02:00
Nicolas Dumazet
15e204f50d bundlerepo: unify common code into a new getremotechanges
The pattern where we fetch incoming remote changes and return
them as a local bundlerepo seems common. It's nicer to have this
code unified.
2010-10-14 22:41:43 +02:00
Juan Pablo Aroztegi
ddaf681e52 transplant: add the transplanted revset predicate
This adds support to identify a particular transplanted changeset or set
of changesets. The argument is optional. Examples:

hg log -r 'transplanted(1234 or 2345)'
hg log -r 'transplanted()'
2010-09-28 19:36:05 +02:00
Peter Arrenbrecht
29816e62a9 transplant: fix var name conflict introduced by 2bc37c36314e 2010-09-18 08:30:11 +02:00
Matt Mackall
cdb9f7c881 bundlerepo: restore close() method 2010-09-20 16:14:05 -05:00
Matt Mackall
40f75a026a bundlerepo: drop unused close() method 2010-09-17 19:03:13 -05:00
Peter Arrenbrecht
1aec67382d transplant: maintain list of transplants in dict 2010-09-16 16:00:29 +02:00
Martin Geisler
112ea7d5ed patch: break import cycle with cmdutil
The patch module imported cmdutil but used it only in updatedir.
2010-09-13 13:08:09 +02:00
Martin Geisler
5f46f16fb7 Lowercase error messages 2010-08-29 22:37:58 +02:00
Peter Arrenbrecht
8f2d068a05 discovery: avoid discovery when local graph is a subset of remote
Immediately sends local's heads to the server to check whether the server knows them all.
If it does, we can call getbundle immediately.

Interesting test output changes are:

-  added 1 changesets with 0 changes to 1 files (+1 heads)
+  added 1 changesets with 0 changes to 0 files (+1 heads)

-> The new getbundle() actually fixes a bug vs. changegroupsubset() in that it no longer
returns unnecessary files when file revs are reused.

warning: repository is unrelated
+  requesting all changes

-> The new use of common instead of bases correctly indicates that an unrelated pull
gets all changes from the server.
2011-03-23 16:06:55 +01:00
Patrick Mezard
bd8804161f i18n: register new template keywords for translation 2011-03-19 19:50:55 +01:00
Patrick Mezard
ef8d429854 transplant: add "transplanted" keyword
$ hg log --template '{rev} {transplanted}\n'
  7 a53251cdf717679d1907b289f991534be05c997a
2011-03-17 22:17:27 +01:00
Martin Geisler
d5f1c9d5be merge with stable 2011-03-13 13:05:16 +01:00
Luke Plant
6db67a02e4 transplant: added 'HGREVISION' variable to the environment passed to the 'filter' command
Sometimes it is necessary to know the original revision ID in order to
correctly rewrite the patch or commit message when transplanting.  This
patch follows the pattern set by the existing 'HGUSER' environment variable,
and adds a test that covers both HGUSER and HGREVISION.
2011-03-11 15:48:44 +00:00
Greg Ward
692cfc05a8 transplant: crash if repo.commit() finds nothing to commit
(makes issue2135, issue2264 more obvious, but does nothing to fix
either one)

This seems to happen in two distinct cases:
  * patch.patch() claims success but changes nothing (e.g.
    the transplanted changeset adds an empty file that already
    exists)
  * patch.patch() makes changes, but repo.status() fails to report them

Both of these seem like bugs in other parts of Mercurial, so arguably
it's not transplant's job to detect the failure to commit.  However:
  * detecting the problem as soon as possible is desirable
  * it prevents a more obscure crash later, in transplants.write()
  * there might be other lurking (or future) bugs that cause
    repo.commit() to do nothing

Also, in the case of issue2264 (source changesets silently dropped by
transplant), the only way to spot the problem currently is the crash
in transplants.write().  Failure to transplant a patch should abort
immediately, whether it's user error (patch does not apply) or a
Mercurial bug (e.g. repo.status() failing to report changes).
2010-07-18 21:29:29 -04:00
Georg Brandl
9033acc5dc transplant: when reading journal, treat only lines starting with "# " special like patch.extract() does 2010-06-19 12:51:57 +02:00
FUJIWARA Katsunori
ce06b102df help: show value requirement and multiple occurrence of options
this helps users to know what kind of option is:

  - no value is required(flag option)
  - value is required
  - value is required, and multiple occurrences are allowed

each kinds are shown as below:

 -f --force              force push
 -e --ssh CMD            specify ssh command to use
 -b --branch BRANCH [+]  a specific branch you would like to push

if one or more 3rd type options are shown, explanation for '[+]' mark
is also shown as footnote.
2010-06-06 17:25:00 +09:00
Dirkjan Ochtman
cf1de649bd move discovery methods from localrepo into new discovery module 2010-06-07 18:35:54 +02:00
Martin Geisler
efb4a38a04 Use our custom hg reStructuredText role some more
I missed these occurrences on my first scan through the source.
2010-05-18 16:31:10 +02:00
Benoit Boissinot
7dae5be27b i18n: mark more strings for translation 2010-02-19 02:23:38 +01:00
Benoit Boissinot
328394047f fix coding style (reported by pylint) 2010-02-08 15:36:34 +01:00
Matt Mackall
8d99be19f0 many, many trivial check-code fixups 2010-01-25 00:05:27 -06:00
Matt Mackall
cd3ef170f7 Merge with stable 2010-01-19 22:45:09 -06:00
Matt Mackall
595d66f424 Update license to GPLv2+ 2010-01-19 22:20:08 -06:00
Sune Foldager
1a664ccf10 transplant: fix small bug when a patch fails while using --filter 2009-12-03 11:06:44 +01:00
Martin Geisler
a67daaab41 Merge with crew-stable 2009-09-10 10:31:12 +02:00
Mads Kiilerich
b1b6b63079 transplant: Add trailing LF in tmp file for filtering
Transplant filtering used a tmp file ending with the (stripped) commit
message and thus no final LF. Text files not ending with LF is usually
not used on Unix and is thus wrong ;-)

The missing LF had bad consequences because Solaris sed chokes on
unterminated input lines, so

  echo -n foo|sed 's,o,0,g'

doesn't output anything, and the filter used in tests/test-transplant
thus stripped the last (and only) line in the message away on solaris.
2009-09-10 01:56:25 +02:00
Martin Geisler
a17f0cee1b do not translate commit messages
It is not very helpful to have 'Added tag %s for changeset %s' and
similar messages translated into different languages when people work
together using different locales.

We now use English strings without support for translations. If
needed, the user can still supply a custom string for most commands.
2009-07-22 22:50:34 +02:00
Martin Geisler
08188763bd transplant: wrap docstrings at 70 characters 2009-07-26 02:02:10 +02:00
Martin Geisler
0f9cd05325 transplant: better reST formatting 2009-07-22 23:26:27 +02:00
Martin Geisler
f69f24cd76 merge with crew-stable 2009-07-22 22:56:45 +02:00