Commit Graph

7089 Commits

Author SHA1 Message Date
Patrick Mezard
afb494e2e2 subrepo: compare svn subrepo state to last committed revision
A subversion project revisions are a subset of the repository revisions, you
can ask subversion to update a working directory from one revision to another
without changing anything. Unfortunately, Mercurial will think the
subrepository has changed and will commit it again. To avoid useless commits,
we compare the subrepository state to its actual "parent" revision. To ensure
ascending compatibility with existing subrepositories which might reference
fake revisions, we also keep comparing with the subrepo working directory
revision.

NOTE: not sure if this should go in stable or not.
2011-01-22 16:15:40 +01:00
Steve Borho
f5cf898232 win32: win32console.GetStdHandle() can return None
When the Mercurial Python libraries are used within a Windows application with
no console, there is no stderr file handle.
2011-01-21 14:42:15 -06:00
Adrian Buehlmann
aef38e3838 remove pointless os.path.join calls when opening files in .hg/cache
Windows deals just fine with '/' in paths and Mercurial on Windows
already does file accesses elsewhere with mixed \ and / in file
paths anyway.

This patch also makes the static-http repo case use proper URLs of the
form

  http://example.com/repo/.hg/cache/branchheads
  http://example.com/repo/.hg/cache/tags

instead of the entirely pointless

  http://example.com/repo/.hg/cache%5Cbranchheads
  http://example.com/repo/.hg/cache%5tags

(as introduced by 5243ae377617)
2011-01-17 09:37:20 +01:00
Matt Mackall
286ea9ce04 merge with self 2011-02-01 17:53:50 -06:00
Patrick Mezard
15ac0306ee Merge with stable 2011-02-01 21:59:07 +01:00
Mads Kiilerich
0c2d4a2e7e merge with stable 2011-02-01 01:55:45 +01:00
Patrick Mezard
7700d1350b mq: factor out push conditions checks
Some extensions (e.g. hgsubversion) completely override push command. Because
extensions load order is unspecified, if hgsubversion loads before mq, mq
checks about not pushing applied patches will be bypassed. Short of finding a
way to fix load order, extracting the checking logic will allow
hgsubversion-like extensions to run the check themselves.
2011-01-31 22:16:33 +01:00
Matt Mackall
fa4133e7aa util: delay loading of textwrap 2011-01-28 17:02:29 -06:00
Mads Kiilerich
adb37b3b39 merge with stable 2011-01-28 03:09:22 +01:00
Matt Mackall
38d53c9ddd merge with stable 2011-01-27 17:22:37 -06:00
Matt Mackall
b4143e379a help: ssh urls don't allow passwords 2011-01-27 13:29:21 -06:00
Adrian Buehlmann
18144d9b0d commit: use the term SCM instead of RCS
for consistency.

see also da931fd0b5b6
2011-01-18 14:16:27 +01:00
Martin Geisler
a76e121863 backout of e4cb9628354c
Matt and a majority of crew did not like this approach.
2011-01-27 11:15:08 +01:00
Martin Geisler
d23e1973c2 specify C indention style using Emacs file local variables 2011-01-26 12:05:01 +01:00
Patrick Mezard
276b88543c Merge with stable 2011-01-22 16:29:10 +01:00
Steve Borho
fede5fa70d merge with stable 2011-01-22 09:13:04 -06:00
Matt Mackall
f549de8060 revlog: remove stray test in rev() 2011-01-21 16:26:01 -06:00
Benoit Boissinot
2feb9c3b6c merge with main 2011-01-20 20:35:54 +01:00
Matt Mackall
856c224de7 revlog: pass rev to _checkhash 2011-01-18 15:55:48 -06:00
Matt Mackall
275d2d9cb0 revlog: incrementally build node cache with linear searches
This avoids needing to prime the cache for operations like verify
which visit most or all of the index.
2011-01-18 15:55:46 -06:00
Adrian Buehlmann
6fa6b746ad opener: use util.unlink (issue2524) 2011-01-11 14:10:16 +01:00
Adrian Buehlmann
7f4eeda8e6 lock: use util.unlink (issue2537) 2011-01-11 14:10:16 +01:00
Adrian Buehlmann
c83b01e7a1 reintroduces util.unlink, for POSIX and Windows.
windows: factor it out of rename
posix: add alias 'unlink' for os.unlink

Note that this new unlink function now has different semantics than the
unlink() we had before changeset 5c424b3de62c ("rename util.unlink to
unlinkpath").
2011-01-11 14:10:16 +01:00
Adrian Buehlmann
236663ff4c opener: check exception for ENOENT 2011-01-11 14:10:16 +01:00
Adrian Buehlmann
f90344c20e windows.rename: check OSError for EEXIST
For example, if src has been opened with Python's open(), os.rename will
raise EACCES. Continuing in that case is pointless.
2011-01-11 14:10:16 +01:00
Yuya Nishihara
593388c52e url: check subjectAltName when verifying ssl certificate
Now it verifies certificate in the same manner as py3k implementation:
http://svn.python.org/view/python/branches/py3k/Lib/ssl.py?view=markup#match_hostname
2011-01-09 00:35:36 +09:00
Yuya Nishihara
ecde2415b3 url: fix UnicodeDecodeError on certificate verification error
SSLSocket.getpeercert() returns tuple containing unicode for 'subject'.
Since Mercurial does't support IDN at all, it just returns error for non-ascii
certname.
2011-01-08 21:52:25 +09:00
Adrian Buehlmann
3f7ac1d848 bundlerepo: use less intrusive util.posixfile to open bundle 2011-01-07 10:48:30 +01:00
Adrian Buehlmann
2226216a7c osutil: treat open modes 'w' and 'a' as 'w+' and 'a+' in posixfile
to work around http://support.microsoft.com/kb/899149.

Also, Microsoft's documentation of the CreateFile Windows API says (quote):

  When an application creates a file across a network, it is better to use
  GENERIC_READ | GENERIC_WRITE for dwDesiredAccess than to use
  GENERIC_WRITE alone. The resulting code is faster, because the
  redirector can use the cache manager and send fewer SMBs with more data.
  This combination also avoids an issue where writing to a file across a
  network can occasionally return ERROR_ACCESS_DENIED.
2011-01-15 23:54:01 +01:00
Kevin Bullock
356b5c3414 subrepo: clarify comments in dirty() methods
Just a little change to bring the comments in the dirty() methods of the
various subrepo classes into a uniform structure. This clarifies the
meaning of the states checked.
2011-01-04 10:42:00 -06:00
Erik Zielke
68282c3062 subrepo: make update -C clean the working directory for git subrepos
This makes 'hg update --clean' behave the same way for all three kinds
of subrepositories [hg, svn, git]. Before git subrepos did not take
the clean parameter into account, but just updated to the given
revision and merged uncommitted changes into that.
2011-01-31 13:40:05 +01:00
Martin Geisler
17df79113a merge with stable 2011-01-31 13:38:00 +01:00
Oleg Stepanov
501d7926e8 subrepo: do not report known files inside repositories as unknown 2011-01-04 03:53:11 -08:00
jfh
a52d7e5744 move tags.cache and branchheads.cache to a collected cache folder .hg/cache/
The generation of cache files like tags.cache and branchheads.cache is not an
actual reflection of things changing in the whole of the .hg directory (like eg
a commit or a rebase or something) but instead these cache files are just part
of bookkeeping. As such its convienant to allow various clients to ignore file
events to do with these cache files which would otherwise cause a double
refresh. Eg one refresh might occur after a commit, but the act of refreshing
after the commit would cause Mercurial to generate a new branchheads.cache which
would then cause a second refresh, for clients.

However if these cache files are moved into a directory like eg .hg/cache/ then
GUI clients on OSX (and possibly other platforms) can happily ignore file events
in this cache directory.
2011-01-04 06:29:08 +01:00
Benoit Boissinot
9d61e1d978 addchangegroup: document the current locking semantics 2011-01-16 17:26:34 +01:00
Benoit Boissinot
8acffa3308 revlog: explicit test and explicit variable names 2011-01-16 12:25:46 +01:00
Benoit Boissinot
3ada8fe22e revlog: if the nodemap is set, use the fast version of revlog.rev() 2011-01-16 12:24:48 +01:00
Benoit Boissinot
383d62511b revlog/parseindex: construct the nodemap if it is empty 2011-01-15 15:06:53 +01:00
Benoit Boissinot
4072e97b7c revlog: always add the magic nullid/nullrev entry in parseindex 2011-01-15 13:02:19 +01:00
Benoit Boissinot
b75c111431 revlog/parseindex: no need to pass the file around 2011-01-15 15:04:58 +01:00
Benoit Boissinot
6c18ebff9d parsers.c: fix comment 2011-01-15 12:44:28 +01:00
Matt Mackall
3d98b5db9a pure: update index parsing 2011-01-12 13:54:39 -06:00
Matt Mackall
1e3dbac7f5 revlog: do revlog node->rev mapping by scanning
Now that the nodemap is lazily created, we use linear scanning back
from tip for typical node to rev mapping. Given that nodemap creation
is O(n log n) and revisions searched for are usually very close to
tip, this is often a significant performance win for a small number of
searches.

When we do end up building a nodemap for bulk lookups, the scanning
function is replaced with a hash lookup.
2011-01-11 21:52:03 -06:00
Matt Mackall
a1c37f5749 revlog: introduce a cache for partial lookups
Partial lookups are always O(n), and often we look up the same
one multiple times.
2011-01-11 17:12:32 -06:00
Matt Mackall
148e99b0ed tags: avoid a pointless usage of revlog.nodemap 2011-01-11 17:09:06 -06:00
Matt Mackall
846d35e24f revlog: only build the nodemap on demand 2011-01-11 17:01:04 -06:00
Matt Mackall
efaaee2894 revlog: remove lazy index 2011-01-04 14:12:52 -06:00
Mads Kiilerich
e45cfbe202 merge with stable 2011-01-11 02:48:58 +01:00
Patrick Mezard
6f893497c0 mail: fix regression when parsing unset smtp.tls option 2011-01-07 20:50:42 +01:00
Kevin Bullock
e69254e948 subrepo: fix svnsubrepo.dirty() checking of ignoreupdate (issue2499)
The ignoreupdate flag to subrepo.dirty(), introduced in 55e4073493fc, is
correctly checked with this change.
2011-01-04 11:33:47 -06:00
Matt Mackall
06f318150a filelog: move metadata parsing to a helper function 2011-01-06 17:04:47 -06:00
Matt Mackall
a399da7502 revlog: break hash checking into subfunction 2011-01-06 17:04:41 -06:00
Matt Mackall
2a8c2e15b4 ui: add configpath helper 2011-01-06 17:04:33 -06:00
Eduard-Cristian Stefan
c66ec9cf09 url: expand path for web.cacerts 2011-01-02 15:30:12 +02:00
Martin Geisler
d2eec2cbbc commands: clarify which aliases "hg help -v" show (issue2572) 2011-01-05 10:47:35 +01:00
Adrian Buehlmann
721e368ac1 rename util.unlink to unlinkpath 2011-01-02 19:34:41 +01:00
Martin Geisler
dc8a50e193 merge with stable 2011-01-05 15:56:03 +01:00
Matt Mackall
49ec3df937 merge with stable 2011-01-01 18:42:04 -06:00
Yuya Nishihara
7e36de64c5 util: fix ellipsis() not to break multi-byte sequence (issue2564)
It tries to convert localstr to unicode before truncating.
Because we cannot assume that the given text is encoded in local encoding,
it falls back to raw string in case of unicode error.
2010-12-25 21:59:00 +09:00
Matt Mackall
e6a9c922d9 hgweb: abort if config file isn't found 2010-12-29 15:23:16 -06:00
Matt Mackall
6b199f1d8d date: fix matching of underspecified date ranges
(backport of 7bca0f2718ab to stable)
2010-12-29 14:19:31 -06:00
Adrian Buehlmann
bfc33d780a windows.rename: eliminate temp name race (issue2571)
On Windows, os.rename reliably raises OSError with errno.EEXIST if the
destination already exists (even on shares served by Samba).

Windows does *not* silently overwrite the destination of a rename.

So there is no need to first call os.path.exists on the chosen temp path.

Trusting os.path.exists is actually harmful, since using it enables the
following racy sequence of actions:

 1) os.path.exists(temp) returns False
 2) some evil other process creates a file with name temp
 3) os.rename(dst, temp) now fails because temp has been taken

Not using os.path.exists and directly trying os.rename(dst, temp)
eliminates this race.
2010-12-27 01:12:31 +01:00
Steve Borho
5d527f9378 match: support reading pattern lists from files 2010-12-23 15:12:24 -06:00
Matt Mackall
f6fde7c0c9 merge with stable 2010-12-29 15:31:25 -06:00
Matt Mackall
8946a77df1 date: fix matching of underspecified date ranges
In a date like 10:30, there are two underspecified ends: the specific
end (seconds) and the broad end (day, month, year). When matching
"10:30", we need to allow the specific end to go from 0 to 59 seconds,
while the broad end is assumed to be today's date.

Similar handling applies for a date range like "Mar 1": year is fixed
to today, any time matches.
2010-12-29 14:04:47 -06:00
Matt Mackall
68fbaea0de merge with stable 2010-12-29 11:18:27 -06:00
Dan Villiom Podlaski Christiansen
83b3b076d6 hooks: sort any dictionaries set in the environment
The actual order of dictionary items is implementation-defined in
Python, and differs between CPython and PyPy. With this change,
test-hooks.t passes with PyPy.
2010-12-24 15:22:00 +01:00
Matt Mackall
ceea1a202f merge with stable 2010-12-28 13:31:30 -06:00
Zhigang Wang
5376237d45 smtp: fix for server doesn't support starttls extension
Currently we only support enabling TLS by using SMTP STARTTLS extension. But
not all the servers support it.

With this patch, user can choose which way to enable TLS:

* Default:

      tls = none
      port = 25

* To use STARTTLS:

      tls = starttls
      port = 465

* To use SMTP over SSL:

      tls = smtps
      port = 465

To keep backward compatibility, when tls = true, we use STARTTLS to enable TLS.

Signed-off-by: Zhigang Wang <w1z2g3@gmail.com>
2010-12-20 16:56:54 +08:00
Adrian Buehlmann
942d5fa3d6 checknlink: use two testfiles (issue2543)
Preventing file loss repository corruption (e.g. vanished changelog.i) when
Mercurial pushes to repositories on Windows shares served by Samba.

This is a workaround for Samba bug 7863, which is present in current latest
stable Samba 3.5.6 and various prior versions down to 3.0.26a (the oldest one
I tested).

Of course this should be fixed in Samba, but there probably aren't that many
other applications who use hardlinks that extensively and keep files open like
Mercurial, so the pressure to fix this on Samba is probably not that high. And
even if the Samba project should be able to fix their bug within a month or
two, it will take quite some time until users upgrade their Samba installs.
2010-12-13 22:38:06 +01:00
John Peberdy
2b3c69e04a help: correct documentation for branches keyword 2010-12-19 21:49:54 -05:00
Mads Kiilerich
d9f11887ef https: use web.cacerts configuration from local repo to validate remote repo 2010-12-27 17:49:58 +01:00
Steve Borho
8562094eb1 util: concentrate quoting knowledge to windows.py quotecommand()
This fixes all callers of util.quotecommand() and place special knowledge
of the bugfix in 2.7.1 in a single platform specific place.
2010-12-22 13:25:00 -06:00
Matt Mackall
64de41cf08 url: fix trailing whitespace 2010-12-20 15:26:36 -06:00
Adrian Buehlmann
9638578b5c fncachestore: copy dh directory before the manifest
Before this patch, the copy order on clone was:

  requires
  00changelog.i
  store\data
  store\00manifest.d
  store\00manifest.i
  store\00changelog.d
  store\00changelog.i
  store\dh
  store\fncache

Which provides a theoretical non-zero probability of a race during clone where
a very early reader might see a repository with missing revlog files if it sees
00changelog.i before all files inside dh have been copied.

The dh directory is similar to the data directory -- just for files with long
names (which are hashed). The manifest refers to files in data *and* dh, so dh
should be copied before the manifest.

This patch improves the copy order to:

  requires
  00changelog.i
  store\data
  store\dh
  store\fncache
  store\00manifest.d
  store\00manifest.i
  store\00changelog.d
  store\00changelog.i

I'm putting fncache to before the manifest while I'm at it, since fncache
provides a mechanism to enumerate all repository files without visiting the
manifest revisions. fncache depends only on data and dh.

Note that data must be copied first, since copying data triggers the creation
of the repository write lock in the destination repo (see hg.clone).
2010-12-17 10:40:26 +01:00
Mads Kiilerich
97213d6b00 https: warn when server certificate isn't verified
Mercurial will verify HTTPS server certificates if web.cacerts is configured,
but it will by default silently not verify any certificates.

We now warn the user that when the certificate isn't verified she won't get the
security she might expect from https:
  warning: localhost certificate not verified (check web.cacerts config setting)

Self-signed certificates can be accepted silently by configuring web.cacerts to
point to a suitable certificate file.
2010-12-18 21:58:52 +01:00
Kevin Bullock
6d031e2cdb tag: abort if not at a branch head (issue2552)
Since it's usually only desirable to make tag commits on top of branch
heads, abort if the working dir parent is not a branch head. -f/--force
may be passed to commit at a non-head anyway.

Does not abort if working dir parent is a named branch head but not a
topological head.
2010-12-06 22:04:10 -06:00
Kevin Bullock
90e6b3e885 tag: fix uncommitted merge check and error message (issue2542)
This patch corrects the check for tagging on an uncommitted merge. We
should never commit a new tag changeset on an uncommitted merge, whether
or not --rev is specified. It also changes the error message from:

  abort: cannot partially commit a merge (do not specify files or patterns)

to the much more accurate (and terse):

  abort: uncommitted merge

Local tags are ok.
2010-12-07 08:02:54 +01:00
Kevin Bullock
85d737621f tag: don't check .hgtags status if --local passed
Local tags don't create a commit, so we don't need to check the status
of .hgtags.
2010-12-13 21:20:30 -06:00
Steve Borho
1493f6fe1b util: work around behavior change in Python 2.7.1 2010-12-13 11:51:01 -06:00
Matt Mackall
be1d11e804 hook: fix import path handling for repo=None 2010-12-10 19:18:02 -06:00
Alexander Solovyov
e86de517fe hook: assume relative path to hook is given from repo root 2010-12-07 15:27:04 +01:00
Matt Mackall
eec34ddf7c subrepo: backed out changeset 9ce26f91f137 2010-12-10 19:08:17 -06:00
Mads Kiilerich
9933c7a60f subrepo: initialize subrepo relative default paths relative to their root 2010-12-10 01:30:16 +01:00
Brodie Rao
08a14dad90 archival: don't set gzip filename header when there's no filename
This mainly affects hgweb, which can generate tar.gz archives without
filenames. Without this change, the header would be set to ".gz",
which can confuse Safari into extracting the file and renaming it to
"gz" when "Open 'safe' files after downloading" is enabled.

file(1) before:

hg-crew-439421eab08d.tar.gz: gzip compressed data, was ".gz", last modified: Thu Dec  2 11:46:20 2010, max compression

after:

hg-crew-439421eab08d.tar.gz: gzip compressed data, last modified: Thu Dec  2 11:46:20 2010, max compression
2010-12-07 19:47:53 +11:00
Patrick Mezard
744f417d4c patch: write .rej files without rewriting EOLs
Do not pass reject file content to patchfile.writelines() to:
- Avoid line endings transformations
- Avoid polluting overriding implementations with unrelated data. They should
  override write_rej() to deal or ignore reject files properly.

Bug report, analysis and original patch and test by
Shun-ichi GOTO <shunichi.goto@gmail.com>
2010-12-03 11:40:30 +09:00
David Soria Parra
e107057815 avoid .split() in for loops and use tuples instead
split can be more readable for longer lists like the list in
dirstate.invalidate. As dirstate.invalidate is used in wlock() and therefoe
used heavily, I think it's worth avoiding a split there too.
2010-12-02 03:43:06 +01:00
Oli Thissen
19beab3bf6 hgweb: added revision date to annotate line data
The only revision information yielded by the annotate view was the revision
number itself. The patch allows the use of per-line revision dates in the
corresponding templates.
2010-12-06 16:56:06 +01:00
Jim Hague
e572ae4bd8 opener: forbid paths ending with directory separator (issue2507)
If Linux is asked to open a filename with a trailing directory separator,
e.g. "foo/", the open fails with EISDIR. On AIX, the open succeeds, opening
file "foo". This causes test-mq-qnew to fail on AIX.

Fix by adding 'ends with directory separator' to the conditions checked
by the path auditor. Change test to expect auditor fail message.
2010-12-17 12:05:45 +00:00
Mads Kiilerich
2f015848bf merge with stable 2010-12-27 17:54:45 +01:00
Mads Kiilerich
b89ce1b270 extensions: warn about invalid extensions when listing disabled commands
Invalid extensions in hgext/ could in some cases cause a crash when searching
for unknown commands in disabled extensions.

With this change we issue a warning if extracting commands from the extensions
fails. Traceback is available on request.

Reported on https://bugzilla.redhat.com/show_bug.cgi?id=663183 with forest.py.
2010-12-26 00:43:49 +01:00
Steve Borho
cd3b55bab4 merge with stable 2010-12-23 13:23:20 -06:00
Matt Mackall
a892ad5a23 templater: clarify engine caching 2010-12-22 13:16:03 -06:00
Eric Eisner
5a68596380 subrepo: basic support for status of git subrepos 2010-12-20 13:59:33 -05:00
Eric Eisner
ca54cd3a42 subrepo: fix subrelpath for git subrepos
This patch conforms gitsubrepo code to the variable naming scheme of the other
subrepo implementations. All user-facing path references should be relative
to the root repository.
2010-12-20 13:59:33 -05:00
Eric Eisner
ec2e32efb2 subrepo: fix git archive parsing of directories and symfiles 2010-12-20 13:59:33 -05:00
Eric Eisner
056bbfc80f subrepo: support ignoreupdate in gitsubrepo's dirty() 2010-12-20 13:59:33 -05:00
Eric Eisner
c6b2baa3dd subrepo: backout 4f4b977c5189
Unfortunately git 1.6 does not support the upstream parameter in for-each-ref.
2010-12-20 13:59:19 -05:00
Matt Mackall
86bd49d7fc url: fix check-code whitespace complaint 2010-12-20 12:12:18 -06:00
Matt Mackall
0b9296f805 templater: use the parser.py parser to extend the templater syntax 2010-12-20 12:09:00 -06:00
Matt Mackall
39437f5a68 templater: give slightly nicer error for unknown map entries 2010-12-20 12:09:00 -06:00
Kevin Bullock
5c61f5f136 mq: update .hgsubstate if subrepos are clean (issue2499)
This patch prevents MQ from creating an inconsistent subrepo state. If
the .hgsub file has been changed, and none of the subrepos have
uncommitted changes, creating or updating a patch (using qnew, qrefresh,
or qrecord) will update .hgsubstate accordingly.

If any subrepos _do_ have uncommitted changes, qnew/qrefresh/qrecord
will abort.

Thanks to pmezard for proposing this solution.
2010-12-07 22:14:43 -06:00
Erik Zielke
d12bb06bf6 subrepo: backout 9f2d8e1439d7
backing out 9f2d8e1439d7 because it introduced a bug in
.hgsubstate handling.
2010-12-17 13:38:15 +01:00
Matt Mackall
02e03e68fb merge with stable 2010-12-20 12:08:50 -06:00
Mads Kiilerich
298ff06c2d merge with stable 2010-12-18 22:06:11 +01:00
Greg Ward
885d349b11 merge: document some internal return values. 2010-12-13 11:46:31 -05:00
Matt Mackall
cdcb8c0f47 check-code: catch "except as" 2010-12-16 14:50:36 -06:00
Mads Kiilerich
9772d9af5a merge: fast-forward merge with descendant
issue2538 gives a case where a changeset is merged with its child (which is on
another branch), and to my surprise the result is a real merge with two
parents, not just a "fast forward" "merge" with only the child as parent.

That is essentially the same as issue619.

Is the existing behaviour as intended and correct?

Or is the following fix correct?

Some extra "created new head" pops up with this fix, but it seems to me like
they could be considered correct. The old branch head has been superseeded by
changes on the other branch, and when the changes on the other branch is merged
back to the branch it will introduce a new head not directly related to the
previous branch head.

(I guess the intention with existing behaviour could be to ensure that the
changesets on the branch are directly connected and that no new heads pops up
on merges.)
2010-12-07 03:29:21 +01:00
Eric Eisner
8113ebb989 template: add showbranch template for {branch}
Like showbranches, but always yields exactly one branch. Replaces the less
correct {branches|nonempty}.
2010-12-13 10:30:15 -05:00
Adrian Buehlmann
31d1e36f3f makedirs: abort if parent == name (issue2531)
catches unknown drive letters on Windows
2010-12-01 21:15:31 +01:00
Erik Zielke
19fa82cefe subrepo: avoids empty commit when .hgsubstate is dirty (issue2403)
This patch avoids empty commit when .hgsubstate is dirty. Empty commit
was caused by .hgsubstate being updated back to the state of the
working copy parent when committing, if a user had changed it manually
and not made any changes in subrepositories.

The subrepository state from the working copies parent is compared
with the state calculated as a result of trying to commit the
subrepositories. If the two states are the same, then return None
otherwise the commit is just done.

The line: "committing subrepository x" will be written if there is
nothing committed, but .hgsubstate is dirty for x subrepository.
2010-11-29 09:37:23 +01:00
Eric Eisner
06990b8d8e subrepo: use low-level git-diff-index for dirty()
Despite its name, git-diff-index compares a revision to the files in the
working directory. This seems way less sketchy and more future proof than
parsing human-readable git-status.
2010-12-14 21:58:13 -05:00
Eric Eisner
1e1100a33b subrepo: defer determination of git's current branch 2010-12-14 21:56:43 -05:00
Eric Eisner
2c85454675 subrepo: incorporate tracking branches into gitbranchmap 2010-12-14 21:56:43 -05:00
Eric Eisner
26d7ede580 subrepo: use low-level git-for-each-ref command in branchmap
This command's output doesn't change across versions, and it also
disambiguates cases where there are slashes in local branch names.
2010-12-14 21:53:40 -05:00
Martin Geisler
290569c6d1 subrepo: add progress bar support to archive 2010-11-29 16:34:10 +01:00
Martin Geisler
70d929229e archive: add support for progress extension 2010-11-29 16:17:05 +01:00
Matt Mackall
4866a8eb9e subrepo: re-backout 9ce26f91f137
This bug got introduced into default simultaneously with its backout,
so future merges didn't eradicate it.
2010-12-14 18:10:51 -06:00
Matt Mackall
fbcb895f80 merge with stable 2010-12-14 17:10:01 -06:00
Wagner Bruna
e391a0d422 hgwebdir: fix incorrect index generation for invalid paths (issue2023)
8aa8db6deb47 moved the subdirectory match inside the repository match
loop. A virtual path existing/path/invalid/path would then match
existing/path, and generate a wrong index page.
2010-11-30 12:45:25 -02:00
Adrian Buehlmann
ca7126202b serve: fix doc typo 2010-11-26 18:45:35 +01:00
Adrian Buehlmann
848dac9692 makedate: abort on negative timestamps (issue2513)
catches weird clock settings
2010-11-24 19:31:43 +01:00
Adrian Buehlmann
9817658bbd parsedate: abort on negative dates (issue2513)
catches "hg commit -d '-7654321 3600'" (example)
2010-11-24 19:31:43 +01:00
Nicolas Dumazet
0885c6dc3f util: do not recurse in makedirs if name is '' (issue2528) 2010-11-30 17:48:12 +09:00
Adrian Buehlmann
a5a62b9b6f util.datestr: do not crash on revisions with negative timestamp (issue2513)
Python's time.gmtime(lt) fails on Windows, producing a traceback with

  ValueError: (22, 'Invalid argument')

if lt < -43200.

We get a local time boundary value of -43200 if we take "the epoch"

   Thu Jan 01 00:00:00 1970 = time.gmtime(0)

from timezone 'UTC+0' into timezone 'UTC-12'. All other timezones will have
larger local time values for that point in time.

Aborting with a traceback on 'hg log' for revisions with a timestamp value
< -43200 is clearly not acceptable.

Returning "invalid timestamp" or similar as string representation is not an
option either, since that may crash other tools which parse the output of
'hg log'.

Instead, we teach util.datestr() to return the epoch in timezone UTC+0 on
*all platforms*, represented by the string

  Thu Jan 01 00:00:00 1970 +0000

if the timestamp's unix time value is negative.

(based on a patch originally proposed by Benjamin Pollack)
2010-11-23 13:11:40 +01:00
Adrian Buehlmann
c0bc968f19 checknlink: return False if .hgtmp file preexists (issue2517)
If os_link fails on Windows, errno is always errno.EINVAL,
so we can't really say if the testlink could not be created
because (a) the FS doesn't support hardlinks or (b) there
is a leaked .hgtmp file lying around from a previous crashed
run.

So let's err on the safe side, keep the code simple and assume
we can't detect hardlinks in both cases.
2010-11-23 22:53:47 +01:00
Wagner Bruna
40109aa29c templater: fix variable name
'format' was renamed to 'parsed' in ec66346c8238
2010-11-18 19:52:58 -02:00
Patrick Mezard
2539fe4ece subrepo: handle missing subrepo spec file as removed
Otherwise, all commands involving a dirstate walk will abort when trying to
readone of them. Deleting .hgsub basically breaks a repository.
2010-11-18 23:05:10 +01:00
Patrick Mezard
f94cde7dfe subrepo: prune empty directories when removing svn subrepo 2010-11-17 21:25:23 +01:00
Patrick Mezard
ef53dec68d subrepo: use subprocess directly to avoid python 2.6 bug
Using svn subrepos on MacOSX with native python 2.6.1 results in a lot of
unexpected output caused by:

    http://bugs.python.org/issue5099
    subprocess.Popen.__del__ causes AttributeError (os module == None)

Avoiding dangling Popen instance solves the issue.
2010-11-17 21:24:36 +01:00
Patrick Mezard
b43cfa6a0e subrepo: fix removing read-only svn files on Windows 2010-11-17 21:00:47 +01:00
Dan Villiom Podlaski Christiansen
d256bab10f posix: remove is-comparison between integers
Comparing integers by identity relies on a CPython implementation
detail of caching integers between -5 and 256.[1]

[1] <http://docs.python.org/c-api/int.html#PyInt_FromLong>
2010-11-16 21:35:58 +01:00
Dan Villiom Podlaski Christiansen
8612617f1e httprepo: remove is-comparison with string literal
An identity check between a variable and a string literal was added to
the pushkey implementation in c77f1a86a050. While CPython will
normally intern strings and thus make the test safe, value identity is
what should be used here.
2010-11-16 21:35:58 +01:00
Matt Mackall
6d71ce3347 commit: search both parents for missing copy revision (issue2484)
raise a proper abort if we can't find an ancestor
2010-11-15 17:04:55 -06:00
Matt Mackall
51394cd31b context: walk both parents for workingctx.ancestors() 2010-11-15 17:00:43 -06:00
Nicolas Dumazet
c2c4887231 log: fix log -rREV FILE when REV isnt the last filerev (issue2492)
Regression from 9f0026001bfd. That previous commit is not supposed
to affect log calls without --follow, so we step out of this
codepath if follow is not True, and it's enough to fix the
regression.

When --follow is given, we fix the issue by taking into account
changesets that have a rev > maxrev to build the filegraph: even if
those files are not included in the final result, it's still needed
to walk correctly the graph from the end of the filelog to minrev, to
track accurately renames.
2010-11-11 02:10:37 +09:00
Nicolas Dumazet
cc0f0d500b cmdutil: move range check outside of filerevgen
Simple refactor, no logic change.
2010-11-11 02:05:02 +09:00
Matt Mackall
509a829041 pushkey: force HTTP POST on push and add tests (issue2489) 2010-11-12 01:21:45 -06:00
Yuya Nishihara
675210cf34 win32: remove try-catch block of GetModuleFileNameEx (issue2480)
According to the API document, GetModuleFileName is the preferred way to
retrieve the filename of the current process. So we shouldn't try
GetModuleFileName'Ex' first.

Previously system_rcpath_win32() happened to return unicode paths due to
GetModuleFileNameEx (issue2480). This problem is fixed as GetModuleFileName
never return unicode.
2010-11-11 01:12:51 +09:00
Richard Hopkins
67793c0851 gpg, commands: fixed util.abort to util.Abort typos
gpg: Fixed util.abort typo after entering wrong password.
commands: Fixed util.abort typo in debugindex.
2010-11-09 20:25:56 +00:00
Klaus Koch
ac02ce2890 bundlerepository: get rid of temporary bundle files (issue2478)
This bug was introduced in a768ccd401c8 and 90b501357394.
2010-11-07 20:18:57 +01:00
Martin Geisler
59ef340ccd bundlerepository: test self.tempfile field, not tempfile module
This error was introduced in 1893dad24f90.
2010-11-10 15:38:00 +01:00
timeless
595318704d help: urls help should include see also for paths 2010-11-10 04:53:11 -06:00
Matt Mackall
f1d46456ee merge with crew 2010-11-08 17:16:17 -06:00
Nicolas Dumazet
74d80b6b4f graphmod: safer code when a changeset has two identical parents
While this situation should never under normal use, some real
life repos sometimes contain such changesets (older hg versions,
broken rebases, etc...)

hgweb was displaying an "Internal error" in this case, and graphlog
displayed a redundant branch all the way to null: it does not cost us
much to just ignore this extra parent when constructing the DAG.
2010-11-08 22:45:56 +09:00
Adrian Buehlmann
b1824b07a4 opener: check hardlink count reporting (issue1866)
The Linux CIFS kernel driver (even in 2.6.36) suffers from a hardlink
count blindness bug (lstat() returning 1 in st_nlink when it is expected
to return >1), which causes repository corruption if Mercurial running
on Linux pushes or commits to a hardlinked repository stored on a Windows
share, if that share is mounted using the CIFS driver.

This patch works around issue1866 and improves the workaround done in
65e082ae3076 to fix issue761, by teaching the opener to lazily execute a
runtime check (new function checknlink) to see if the hardlink count
reported by nlinks() can be trusted.

Since nlinks() is also known to return varying count values (1 or >1)
depending on whether the file is open or not and depending on what client
and server software combination is being used for accessing and serving
the Windows share, we deliberately open the file before calling nlinks() in
order to have a stable precondition. Trying to depend on the precondition
"file closed" would be fragile, as the file could have been opened very
easily somewhere else in the program.
2010-11-07 18:21:29 +01:00
Nicolas Dumazet
f48c256c16 revlog: fix descendants() if nullrev is in revs
We were not returning the correct result if nullrev was in revs, as we
are checking parent(currentrev) != nullrev before yielding currentrev

test-convert-hg-startrev was wrong: if we start converting from rev -1 and
onwards, all the descendants of -1 (full repo) should be converted.
2010-11-07 18:23:48 +09:00
Nicolas Dumazet
31a27ed9b9 revlog: if start is nullrev, end is always a descendant 2010-11-07 18:16:07 +09:00
Steve Losh
3171599307 alias: fall back to normal error handling for ambigious commands (fixes issue2475) 2010-11-05 15:54:32 -04:00
Ronny Pfannschmidt
7701046742 subrepo: test & fix svn subrepo removal 2010-11-05 15:13:22 +01:00
Adrian Buehlmann
57283f18cb util: refactor opener
- Don't call atomictempfile or nlinks() if the path is malformed
  (no basename). Let posixfile() raise IOError directly.
- atomictempfile already breaks up hardlinks, no need to poke
  at the file with nlinks() if atomictemp.
- No need to copy the file contents to break hardlinks for 'w'rite
  modes (w, wb, w+, w+b). Unlinking and recreating the file is faster.
2010-11-04 09:04:37 +01:00
Matt Mackall
341df0d469 dirstate: skip optimization on case-folding FS (issue2440) 2010-11-01 14:18:42 -05:00
Mads Kiilerich
0f04e7650d url: fix https client authentication through proxy
There is no tests for this, but the parameter order was obviously wrong.
2010-11-01 01:56:12 +01:00
Matt Mackall
bc13e3d384 commit: handle missing newline on last commit comment 2010-10-30 12:13:52 -05:00
Patrick Mezard
00e188f176 localrepo: do not modify ctx.remove() list in-place 2010-11-01 17:26:08 +01:00
Matt Mackall
627b247624 demandimport: back out ccffe6051751 (issue2467) 2010-10-30 11:32:04 -05:00
Matt Mackall
dbab506672 debugindex: add --format flag to allow debugging parentdelta
-f 1 shows extra data from revlogv1 (aka revlogng) including flags and size

(based on a patch by Pradeepkumar Gayam <in3xes@gmail.com>)
2010-10-30 02:47:35 -05:00
Matt Mackall
90141f6021 revlog: choose best delta for parentdelta (issue2466)
When parentdelta is enabled, we choose the delta that has the minimum
distance to its base. Otherwise, base may be sufficiently far away to
require a full version, resulting in greatly reduced compression.
2010-10-30 02:47:34 -05:00
Matt Mackall
d0eecfc8e5 revlog: precalculate p1 and p2 revisions 2010-10-30 02:47:34 -05:00
Matt Mackall
9e1ed89cc3 revlog: extract delta building to a subfunction 2010-10-30 02:47:34 -05:00
Matt Mackall
4d0c140fd2 revlog: simplify cachedelta handling 2010-10-30 02:47:34 -05:00
Matt Mackall
a758f18a0a revlog: fix buildtext local scope
buildtext stores its result in _addrevision scope to avoid repeated builds
cachedelta is already visible
2010-10-30 02:47:34 -05:00
Martin Geisler
23c9a547e5 opener: do not create "foo" directory when writing to "foo/"
The directories were not cleaned up when the subsequent open failed
and this would confuse things like qnew.
2010-10-29 12:50:08 +02:00
Patrick Mezard
a3c9b27eda patch: fix copies when patching over uncommitted changed (issue2459) 2010-10-28 21:25:53 +02:00
Matt Mackall
fce98d3778 minirst: use colwidth to match title lengths (issue2455) 2010-10-27 15:35:23 -05:00
Matt Mackall
50b99d1a5a encoding: default ambiguous character to narrow
The current implementation of colwidth was treating 'A'mbiguous
characters as wide, which was incorrect in a non-East Asian context.
As per http://unicode.org/reports/tr11/#Recommendations, we should
instead default to 'narrow' if we don't know better. As character
width is dependent on the particular font used and we have no idea
what fonts are in use, this recommendation applies.

This introduces HGENCODINGAMBIGUOUS to get the old behavior back.
2010-10-27 15:35:21 -05:00
Steve Borho
dde38080ab Merge with stable 2010-12-13 12:19:26 -06:00
Martin Geisler
fdfec2742f merge default heads in crew and main 2010-12-13 11:52:52 +01:00
Benoit Boissinot
d2ea44dc59 merge with stable 2010-12-10 23:05:48 +01:00
Matt Mackall
6bcc439bb1 merge with stable 2010-12-08 13:12:12 -06:00
Dan Villiom Podlaski Christiansen
c168860461 make_file: always return a fresh file handle that can be closed
Currently, cmdutil.make_file() will return a freshly made file handle,
except when given a pattern of '-'. If callers would want to close the
handle, they would have to make sure that it's neither sys.stdin or
sys.stdout. Instead, returning a duplicate of either of the two
ensures that make_file() lives up to its name and creates a new
file handle regardless of the input.
2010-12-07 16:08:16 +01:00
Matt Mackall
fd486a3def merge with stable 2010-12-10 19:20:11 -06:00
Augie Fackler
11bc43400a bundle progress: offer best-guess deterministic progress information
This uses the same strategy as progress for pulls, estimating manifests
based on changeset count and estimating file count by files list in
each changeset.
2010-12-10 13:30:37 -06:00
Augie Fackler
ae84cccfbf httpsendfile: record progress information during read()
This allows us to provide deterministic progress information during
transfer of bundle data over HTTP. This is required because we
currently buffer the bundle data to local disk prior to transfer since
wsgiref lacks chunked transfer-coding support.
2010-12-10 13:31:06 -06:00
Alexander Solovyov
b7f3f7f2f4 templatekw.showdiffstat: use ctx.diff() instead of calling patch 2010-12-07 15:50:28 +01:00
Adrian Buehlmann
36da7599cc localrepo: remove unneeded os.unlink call in wwrite
The opener already unlinks the filename before 'w'riting, for both
the symlink and the normal file case. It also now resets the flags
for normal files on 'w'rite, which makes this os.unlink call completely
redundant.

For Windows, removing this extra unlink call helps to avoid tripping
issue2524 (os.unlink followed by a write).
2010-12-10 16:10:14 +01:00
Adrian Buehlmann
15eb1de134 opener: always reset flags on 'w'rite
only the patcher needs to preserve flags on write
2010-12-10 15:14:05 +01:00
Eric Eisner
196def6fd2 subrepo: silence git output when ui.quiet is set 2010-12-09 16:52:14 -05:00
Eric Eisner
4c966e44c6 subrepo: show git command with --debug
Also removing the clutter of --no-pager, since none of these commands use
the pager.
2010-12-09 16:52:14 -05:00
Eric Eisner
ca860bf0f2 subrepo: speed up git push logic
In many common cases where the subrepo is up to date with the remote repo,
hg push will only need to run one git-branch command to see that nothing
needs to be pushed.
2010-12-09 16:52:14 -05:00
Eric Eisner
cb90078af4 subrepo: use subprocess.Popen without the shell
As well as simplifying the code, this makes subprocess calls about 25% faster.
Tested on a couple linux boxes.

python -mtimeit -s'import subprocess' 'subprocess.Popen(
        "git version", shell=True, stdout=subprocess.PIPE).wait()'
python -mtimeit -s'import subprocess' 'subprocess.Popen(
	["git","version"], stdout=subprocess.PIPE).wait()'
2010-12-09 16:52:14 -05:00
Eric Eisner
5cc1a07e5a subrepo: treat git error code 1 as success
At least status, commit, merge-base, and diff all return 1 when not failing.
2010-12-09 16:52:14 -05:00
Eric Eisner
d81be05e6d subrepo: gitsubrepo should inherit from abstractsubrepo 2010-12-09 16:52:14 -05:00
Brodie Rao
1d9f172d6c record: move copystat() hack out of util.copyfile() and into record
226847bf9cab updated copyfile to also copy over atimes and
mtimes. That behavior is specifically to trick editors into thinking
files that hg record has modified haven't changed. We don't really
care about preserving times in the general case.
2010-12-07 20:03:05 +11:00
Dan Villiom Podlaski Christiansen
1c69d6eb9a util: make atomicfiles closable 2010-12-07 16:03:42 +01:00
Eric Eisner
44d5bac715 subrepo: drop arguments unsupported by old git 2010-12-06 21:17:27 -05:00
Eric Eisner
6bdb7bc8d7 subrepo: work around old git's remote naming scheme
Older git versions use 'origin/master'
Current git uses 'remotes/origin/master'
2010-12-06 21:17:27 -05:00
Eric Eisner
6c1163de81 subrepo: use environment variable instead of git commit's --date
Older git versions do not have a --date flag.
2010-12-06 21:17:27 -05:00
Eric Eisner
11aba86609 subrepo: parse git status's human-readable output
Older git versions do not have a machine-readable output, but the default
format has not changed over time.
2010-12-06 21:17:27 -05:00
Eric Eisner
d9f3d5258c subrepo: use subprocess's cwd instead of git's --work-tree
Some older git commands (e.g. git merge) do not properly recognize the
--work-tree argument, so abstract that away from git.
2010-12-06 21:17:27 -05:00
Matt Mackall
4b21988877 bdiff: Fix bogus NULL return 2010-12-06 16:59:43 -06:00
Matt Mackall
338e4487bf bdiff: dynamically allocate hunks
Make the hunk list a singly-linked list rather than a large array.
2010-12-06 16:42:48 -06:00
Eric Eisner
433dad3882 subrepo: lazily update git's local tracking branches
This continues the strategy of separation between hg pull and hg update in
git subrepos by only dealing with git's branches on an update. This behavior
tries to cover the bare essentials of the semantics of git pull in the subrepo
when the parent repo does hg pull and hg update.
2010-11-28 17:19:23 -05:00
Eric Eisner
e82449fedc subrepo: return both mapping directions from gitbranchmap 2010-11-28 15:21:23 -05:00
Eric Eisner
597d9a4df9 subrepo: strip gitcommand output 2010-11-28 15:03:48 -05:00
Dan Villiom Podlaski Christiansen
a0d21ffc4d sshrepo: don't use readline() on the stderr pipe
For some reason, the stat/readline dance suppressed lines following
the first in PyPy 1.4.
2010-12-01 21:46:08 +01:00
Dan Villiom Podlaski Christiansen
312fdcf8d8 demandimport: change default for level from None to -1
The Python default for this function is -1, indicating both relative
and absolute imports should be used.[1] Previously, we relied on the
Python VM not passing level when such semantics were
requisted. This is not the case for PyPy, however, where a level of -1
is always passed to __import__.

[1] <http://docs.python.org/library/functions.html#__import__>
2010-12-01 21:46:08 +01:00
Dan Villiom Podlaski Christiansen
811053b2a4 export: flush the file pointer between patches 2010-12-01 21:46:08 +01:00
Thomas Arendsen Hein
6fd4e6aaec coding style: fix gratuitous whitespace after Python keywords 2010-12-03 11:30:45 +01:00
Matt Mackall
15ad3a76d6 merge with stable 2010-12-01 18:47:40 -06:00
Nicolas Dumazet
7e56ad61ee merge with stable 2010-12-01 11:02:12 +09:00
Martin Geisler
dd0f217423 encoding: fix typo in variable name
The typo had no real effect, except for an unnecessary UTF-8 encoding.
2010-11-29 10:13:55 +01:00
Matt Mackall
776084cff3 pushkey: use UTF-8 2010-11-28 18:21:47 -06:00
Matt Mackall
0d5b6162e5 wireproto: use proper UTF-8 handling for key lookup
Lookups happen in the local encoding space, but the wire protocol
should be using UTF-8 for interoperability.
2010-11-24 16:10:37 -06:00
Matt Mackall
8b31da4540 branch: operate on branch names in local string space where possible
Previously, branch names were ideally manipulated as UTF-8 strings,
because they were stored as UTF-8 in the dirstate and the changelog
and could not be safely converted to the local encoding and back.

However, only about 80% of branch name code was actually using the
right encoding conventions. This patch uses the localstr addition to
allow working on branch names as local strings, which simplifies
handling so that the previously incorrect code becomes correct.
2010-11-24 15:56:32 -06:00
Matt Mackall
c7059d3926 encoding: add localstr class to track UTF-8 version of transcoded strings
This allows UTF-8 strings to losslessly round-trip through Mercurial
2010-11-24 15:38:52 -06:00
Steve Borho
f938c786bf Merge with stable 2010-11-24 13:43:40 -06:00
Martin Geisler
a30b4f11ad localrepo: move string formatting out of gettext call 2010-11-24 13:25:12 +01:00
Matt Mackall
3fe296798a dirstate: warn on invalid parents rather than aborting
This allows more graceful recovery from some mangled dirstates
2010-11-22 12:43:31 -06:00
Martin Geisler
6a3d9310ab code style: prefer 'is' and 'is not' tests with singletons 2010-11-22 18:15:58 +01:00
Eric Eisner
47f74e81de subrepo: lazier git push logic
Avoids calls to git push when the revision is already known to be
in the remote repository. Now, when using a read-only git subrepo,
git will never need to talk to its upstream repository.
2010-11-21 22:00:51 -05:00
Eric Eisner
0e03c676b5 subrepo: archive git subrepos 2010-11-18 19:20:21 -05:00
Patrick Mezard
ad186e82b5 Merge with stable 2010-11-21 13:16:59 +01:00
timeless
f425b70af2 revert: improve merge advice and favor its error over all 2010-11-20 20:41:48 +02:00
Patrick Mezard
4795589405 Merge with stable 2010-11-18 23:15:13 +01:00
Patrick Mezard
4c85200b1f Merge with stable 2010-11-17 21:30:13 +01:00
Erik Zielke
cd95a50630 minirst: improved support for option lists.
This enables minirst to parse and print option lists which have both
long and short options. Before, we could only parse option lists with
long options.
2010-11-02 17:44:19 +01:00
Erik Zielke
87792363c2 minirst: modified minirst to also recognize empty comments.
The modifies minirst to also handle empty comments. An empty comment
is a block with a single line containing two dots.
2010-11-16 13:29:08 +01:00
Martin Geisler
4639d37fbb merge with stable 2010-11-17 09:17:55 +01:00
Martin Geisler
c5a85fb04a minirst: better interaction between comments and margins
You can now split a list with a comment:

  * foo

  .. separator

  * bar

and the two list items will no longer be run together, that is the
output is

  * foo

  * bar

instead of

  * foo
  * bar
2010-11-16 11:10:50 +01:00
Matt Mackall
437f851e8f merge with stable 2010-11-15 17:05:54 -06:00
Adrian Buehlmann
c5ab776a53 discovery: list new remote heads in prepush() on --debug
With this patch applied, Mercurial will list the hashes of new remote heads
if push --debug aborts because of new remote heads (option -f/--force not set).

Example:

  $ hg push --debug repo1
  using http://example.org/repo1
  http auth: user johndoe, password not set
  sending between command
  pushing to http://example.org/repo1
  sending capabilities command
  capabilities: changegroupsubset stream=1 lookup pushkey unbundle=HG10GZ,HG10BZ,HG10UN branchmap
  sending heads command
  searching for changes
  common changesets up to 187dd3f0a37d
  sending branchmap command
  new remote heads on branch 'default'        <- new output line
  new remote head 5862c07f53a2                <- new output line
  abort: push creates new remote heads on branch 'default'!
  (did you forget to merge? use push -f to force)

Compare to without --debug (not changed by this patch, including it here
for reference purposes only):

  $ hg push repo1
  pushing to http://example.org/repo1
  searching for changes
  abort: push creates new remote heads on branch 'default'!
  (did you forget to merge? use push -f to force)

Motivation for this change:

'hg outgoing' may list a whole lot of benign changesets plus an odd changeset
that will trigger the "new remote heads" abort. It can be hard to spot that
single unwanted changeset (it may be an old forgotten experiment, lingering
in the local repo).

"hg log -r 'heads(outgoing())'" might be useful, but that also lists a head
that may be benign on push.

Inside prepush(), we already know which heads are causing troubles on 'hg push'.
Why not make that info available (at least on --debug)?

This would also be helpful for doing remote support, as the supporter can ask
the user to paste the output of 'hg push --debug' on error and then ask further
questions about the heads listed.
2010-11-11 15:51:20 +01:00
Adrian Buehlmann
dcf407e791 discovery: remove erroneous comment in prepush()
New named branches *can* be created without -f/--force by specifying
--new-branch
2010-11-11 15:42:27 +01:00
Eric Eisner
c8106b69bb subrepo: removing (and restoring) git subrepo state 2010-11-14 18:31:40 -05:00
Eric Eisner
7c9ab4f118 subrepo: update and merge works with any git branch 2010-11-14 18:31:29 -05:00
Eric Eisner
22744d6861 subrepo: allow git subrepos to push and merge
(master branch only)

gitsubrepo based on patch from David Soria Parra:
http://bitbucket.org/segv/davids-poor-git-subrepo-attempt/
2010-11-14 18:22:33 -05:00
Eric Eisner
244b8e45a7 subrepo: cloning and updating of git subrepos
gitsubrepo based on patch from David Soria Parra:
http://bitbucket.org/segv/davids-poor-git-subrepo-attempt/
2010-11-14 18:20:13 -05:00
Eric Eisner
579b798395 subrepo: support for adding a git subrepo
gitsubrepo based on patch from David Soria Parra:
http://bitbucket.org/segv/davids-poor-git-subrepo-attempt/
2010-11-14 18:15:26 -05:00
Nicolas Dumazet
1126494b0f merge with stable 2010-11-13 11:58:51 +09:00
Matt Mackall
d706c5ce4c merge with stable 2010-11-12 01:22:46 -06:00
Martin Geisler
573e60523a merge with stable 2010-11-11 07:23:38 +01:00
Martin Geisler
9d82b9ed1f check-code: using and/or/not as a function is bad style 2010-11-11 00:08:09 +01:00
Martin Geisler
f8298dbc7f merge with stable 2010-11-10 15:44:19 +01:00
Martin Geisler
c0684c364b minirst: link to HelpStyleGuide in docstring 2010-11-10 14:46:13 +01:00
Nicolas Dumazet
1701ac1b51 util: clarify purpose of MBTextWrapper class
It's easy to get confused and scared of an Unicode monster when
skimming through this code: document that this is really just
about column-counting.
2010-11-09 13:43:35 +09:00
Matt Mackall
df921bb32e merge with crew 2010-11-08 17:16:29 -06:00
Nicolas Dumazet
d11d40059b merge with stable 2010-11-09 01:33:48 +09:00
Matt Mackall
970fa59d54 merge with stable 2010-11-07 16:01:57 -06:00
Patrick Mezard
43a1583455 revset: remove unnecessary debug statement 2010-11-07 18:15:17 +01:00
Patrick Mezard
a6f7f2ff05 revset: fix p1, p2 and parents in dirstate case (60aa454e7734)
- Handle 'subset' argument
- Stop returning the null rev from p1 and parents, as in the non-dirstate case
- Order parents as in the non-dirstate case (ascending revs)
2010-11-07 18:14:42 +01:00
Nicolas Dumazet
7adc6dc3ec context: add __repr__ methods to workingfilectx and workingctx 2010-11-07 18:59:27 +09:00
Matt Mackall
9f16ce2e0a merge with stable 2010-11-05 15:38:23 -05:00
Martin Geisler
f930aa4382 merge with stable 2010-11-05 15:35:39 +01:00
Kevin Bullock
e238d72ecb revsets: let parents() return parents of working dir
This patch makes the 'set' argument to revset function parents() optional.
Like p1() and p2(), if no argument is given, returns the parent(s) of the
working directory.

Morally equivalent to 'p1()+p2()', as expected.
2010-11-04 17:09:00 -05:00
Kevin Bullock
63e0b7b699 revsets: let p1() and p2() return parents of working dir
This patch makes the 'set' argument to revset functions p1() and p2()
optional. If no argument is given, p1() and p2() return the first or second
parent of the working directory.

If the working directory is not an in-progress merge (no 2nd parent), p2()
returns the empty set. For a checkout of the null changeset, both p1() and
p2() return the empty set.
2010-11-04 16:59:03 -05:00
Adrian Buehlmann
2d04aa1493 util: refactor opener
- Don't call atomictempfile or nlinks() if the path is malformed
  (no basename). Let posixfile() raise IOError directly.
- atomictempfile already breaks up hardlinks, no need to poke
  at the file with nlinks() if atomictemp.
- No need to copy the file contents to break hardlinks for 'w'rite
  modes (w, wb, w+, w+b). Unlinking and recreating the file is faster.
2010-11-04 09:04:37 +01:00
Matt Mackall
72b5ba88f5 commands: add revset support to most commands 2010-11-04 16:21:28 -05:00
Ronny Pfannschmidt
83cb2b6070 localrepo: make heads use the keyword args of the sorted builtin 2010-11-02 11:25:52 +01:00
Steve Borho
1b8a5c4173 import: add another line feed to message join string
Changeset descriptions are not guaranteed to have a trailing carriage
return.
2010-11-04 11:33:57 -05:00
Patrick Mezard
209debed48 patch: remove unused applydiff() sourcefile argument 2010-11-03 21:11:07 +01:00