Commit Graph

442 Commits

Author SHA1 Message Date
Jesse Glick
8006327c6e Strip filter name from command before passing to filter function.
The new registration of in-process data filters (introduced in
75177cef51d3 & 8c9fa240ac96) failed to correctly strip the filter name
from its arguments before passing the "command" to the filter
function. Thus a registration such as

[decode]
*.gz = compress: -9

would result in the associated filter function being called with the
argument 'compress: -9' rather than just '-9' as expected.
2008-02-09 12:27:58 -05:00
Alexis S. L. Carvalho
6b4c649e55 make the journal/undo files from transactions inherit the mode from .hg/store 2008-02-09 18:38:54 -02:00
Alexis S. L. Carvalho
918227be30 Make files in .hg inherit the permissions from .hg/store 2008-02-09 18:38:54 -02:00
Thomas Arendsen Hein
7bedf7e312 Do not abort rollback if undo.branch isn't available, but warn. 2008-02-09 19:39:01 +01:00
Thomas Arendsen Hein
4c531a9dd1 Print less scary warning when invalidating the branch cache. 2008-02-09 18:58:31 +01:00
Alexis S. L. Carvalho
961a45df72 merge with crew-stable 2008-02-03 21:47:07 -02:00
Alexis S. L. Carvalho
e61b27b1b7 update the branch cache at the end of addchangegroup
This should avoid a bad performance problem when the branch cache is
not up-to-date, and hgweb can't write an updated version because it
lacks permissions.
2008-02-03 21:03:46 -02:00
Alexis S. L. Carvalho
667f990846 localrepo._tag: add a seek before writing the new tag
Some systems require a seek (or flush) between read and write
operations on the same file object.

This should fix issue838.
2008-02-03 21:03:46 -02:00
Patrick Mezard
205c9daa57 localrepo: ensure files unicity in commit() (issue 714) 2008-01-21 10:02:32 +01:00
Jesse Glick
dc05781c40 Provide better context for custom Python encode/decode filters.
While some can function with just some text and an optional command name,
others may want a repository object, a ui object, and a file path.
Use the enhanced information to good effect in win32text.dumbdecode's warning.
2007-12-21 23:21:17 -05:00
Patrick Mezard
d264d47be0 Register data filters in a localrepo instead of util
- Changing data filters implementation is easier, adddatafilter() can rewrap
  filter after inspecting their prototype
- Custom data filters really belongs to localrepo, mixing them with generic
  wrapper like "pipefilter" or "tempfilter" looks wrong.
- util.filtertable should not be accessed from extensions
2008-01-28 21:39:47 +01:00
Christian Ebert
5c18a69d2e Prefer i in d over d.has_key(i) 2008-01-20 14:39:25 +01:00
Patrick Mezard
8c795eef45 Merge with crew-stable 2008-01-21 14:15:38 +01:00
Alexis S. L. Carvalho
4460ff7619 changegroupsubset: accept list of per-revlog nodes to include
This will allow strip to include in the temporary changegroup some extra
file/manifest revisions that should be restored after the truncations.

This code doesn't allow specification of changelog nodes since I won't
need that right now, the code wouldn't be tested and it's probably
possible to do something similar enough by using the bases/heads
arguments.
2008-01-19 18:01:16 -02:00
Alexis S. L. Carvalho
e39125d9f7 addchangegroup: add option to skip check for empty changelog group 2008-01-19 18:01:16 -02:00
Matt Mackall
a68910fcf1 transactions: don't show a backtrace when journal exists
Now we simply print a message on how to recover.
2008-01-16 11:32:25 -06:00
Alexandre Vassalotti
60c2f6f43d restore branch after rollback (issue 902) 2008-01-07 15:26:12 -06:00
Thomas Arendsen Hein
fd0ebb6a0c Show number of changesets written to bundle files by default (issue569)
This was only shown with -v before.
2007-12-30 19:46:13 +01:00
Thomas Arendsen Hein
347da85c36 Removed tabs and trailing whitespace in python files 2007-12-29 19:49:48 +01:00
Thomas Arendsen Hein
8dbd54d63d Clarify some messages during commit:
- use "branch 'foo'" to distinguish from "branch merge".
- commit messags can be empty (to abort commits)
- Added value for editor message: Tell about HG: lines like CVS does.
2007-12-28 17:10:25 +01:00
Thomas Arendsen Hein
f1499b31ef merge with crew 2007-12-28 16:32:14 +01:00
Patrick Mezard
d9be0f3383 Prompt for a commit message in editor, improve error message 2007-12-28 14:51:16 +01:00
Patrick Mezard
fd1268357e commands: add exits(1) if a specified file cannot be added (issue 891) 2007-12-24 12:14:43 +01:00
Matt Mackall
fbfe5cbaab fix spelling error 2007-12-18 15:40:46 -06:00
John Coomes
e9eb2749fb hg tag: run tag hook just once 2007-12-18 12:45:30 -08:00
John Coomes
5c790a2f5f hg tag: run tag hook just once 2007-12-18 12:45:30 -08:00
Matt Mackall
49c18f282e wwrite: simplify with util.set_flags
- always attempt to delete the file (gets rid of read-only message)
- always write as a normal file
- use set_flags to convert to link or set exec
2007-12-27 22:27:47 -06:00
Osku Salerma
cb7de57ab7 Properly check tag's existence as a local/global tag when removing it. 2007-12-09 16:32:05 +09:00
Matt Mackall
1c590a3f47 commit: avoid losing edits during commit
If a file is edited between the time we record file states in the repo
and update the dirstate, that change can be lost to hg status. Because
we invoke the editor between these two points, that window can be
arbitrarily large.

This greatly shrinks the window by recording the commit change
immediately. If our checkin fails, we simply invalidate the dirstate.
2007-12-10 10:24:29 -06:00
Matt Mackall
c1ac09f205 push/pull: abort if we try to visit a missing or empty revlog 2007-11-21 13:26:18 -06:00
Matt Mackall
305c1ae64c changegroup: avoid large copies
- handle chunk headers separately rather than prepending them to
  (potentially large) chunks
- break large chunks into 1M pieces for compression
- don't prepend file metadata onto (potentially large) file data
2007-10-03 17:17:28 -05:00
Patrick Mezard
c6d86b7b87 Merge with crew-stable 2007-09-23 15:29:58 +02:00
Patrick Mezard
58988c1395 localrepo: fix undelete() on merge working directory (issue 746) 2007-09-23 14:40:44 +02:00
Benoit Boissinot
284f2adff1 remove unneeded statement 2007-08-31 01:21:31 +02:00
Bryan O'Sullivan
eba82ab39c Turn capabilities into a mutable set, instead of a fixed tuple. 2007-08-27 14:16:04 -07:00
Alexis S. L. Carvalho
369cb57512 Merge with crew-stable. 2007-08-27 14:55:33 -03:00
Alexis S. L. Carvalho
4bb4d97472 correctly record file-level history when the local side renames a directory 2007-08-27 14:21:04 -03:00
Alexis S. L. Carvalho
7eed9874b5 Fix theoretical issue in filecommit.
If the file was copied, we don't want to reuse the original entry.

I think this is mostly a theoretical issue - when there are copies,
fp1 == nullid, so it's very unlikely that the fl.cmp(fp1, t) would
think the file was unmodified.  In any case, if there was a copy,
we should forcefully create a new entry.
2007-08-27 14:21:04 -03:00
Alexis S. L. Carvalho
a409e26406 Avoid adding to the changelog executable files added by the second parent.
This was a regression introduced by 349443e942a7.
2007-08-27 14:21:04 -03:00
Alexis S. L. Carvalho
714fa94597 Merge with crew-stable 2007-08-27 02:21:58 -03:00
Alexis S. L. Carvalho
1e3fbe3765 pull -r: pass the revisions as the heads argument of findincoming
This can make a hg pull -r faster if the remote repo has many heads,
and fixes an "abort: received changelog group is empty".
2007-08-27 01:44:35 -03:00
Brendan Cully
1e7be967ee Merge with crew-stable 2007-08-23 12:24:54 -07:00
Brendan Cully
ea30b97aed Do not lose previous tags when adding a tag in raw mode 2007-08-23 12:23:07 -07:00
Alexis S. L. Carvalho
a345c2c9da merge: forcefully mark files that we get from the second parent as dirty
After a hg merge, we want to include in the commit all the files that we
got from the second parent, so that we have the correct file-level
history.  To make them visible to hg commit, we try to mark them as dirty.

Unfortunately, right now we can't really mark them as dirty[1] - the
best we can do is to mark them as needing a full comparison of their
contents, but they will still be considered clean if they happen to be
identical to the version in the first parent.

This changeset extends the dirstate format in a compatible way, so that
we can mark a file as dirty:

Right now we use a negative file size to indicate we don't have valid
stat data for this entry.  In practice, this size is always -1.

This patch uses -2 to indicate that the entry is dirty.  Older versions
of hg won't choke on this dirstate, but they may happily mark the file
as clean after a full comparison, destroying all of our hard work.

The patch adds a dirstate.normallookup method with the semantics of the
current normaldirty, and changes normaldirty to forcefully mark the
entry as dirty.

This should fix issue522.

[1] - well, we could put them in state 'm', but that state has a
different meaning.
2007-08-23 01:48:29 -03:00
Benoit Boissinot
13bbfcaf55 make hg add of a removed file unremove the file
if a file was removed, hg add shouldn't mark the file
as added, but as normal

see issue683
2007-08-21 02:13:32 +02:00
Benoit Boissinot
b71f9f2bbf abort when adding a file in merged state 2007-08-21 02:02:08 +02:00
Matt Mackall
b4f06de2ba remove unneeded imports of mdiff 2007-08-15 16:09:50 -05:00
Bryan O'Sullivan
1b98353d91 Make audit_path more stringent.
The following properties of a path are now checked for:

    - under top-level .hg
    - starts at the root of a windows drive
    - contains ".."
    - traverses a symlink (e.g. a/symlink_here/b)
    - inside a nested repository

If any of these is true, the path is rejected.

The check for traversing a symlink is arguably stricter than necessary;
perhaps we should be checking for symlinks that point outside the
repository.
2007-08-10 10:46:03 -07:00
Thomas Arendsen Hein
001b7980f8 Remove trailing spaces 2007-08-07 10:24:33 +02:00
Alexis S. L. Carvalho
5af674774c del transaction before lock before wlock
This way rollbacks happen while the repo is still locked.

Deleting lock before wlock is not strictly necessary, but is
more consistent with the locking order.
2007-08-02 01:56:08 -03:00