Show More
@@ -382,14 +382,27 b" Handle frickin' frackin' gratuitous even" | |||||
382 | (set-buffer hg-prev-buffer)) |
|
382 | (set-buffer hg-prev-buffer)) | |
383 | (let ((path (or default (buffer-file-name)))) |
|
383 | (let ((path (or default (buffer-file-name)))) | |
384 | (if (or (not path) current-prefix-arg) |
|
384 | (if (or (not path) current-prefix-arg) | |
385 |
|
|
385 | (expand-file-name | |
386 | (read-file-name (format "File, directory or pattern%s: " |
|
386 | (eval (list* 'read-file-name | |
387 | (or prompt "")) |
|
387 | (format "File, directory or pattern%s: " | |
388 | (and path (file-name-directory path)) |
|
388 | (or prompt "")) | |
389 | nil nil |
|
389 | (and path (file-name-directory path)) | |
390 | (and path (file-name-nondirectory path)) |
|
390 | nil nil | |
391 | 'hg-file-history)) |
|
391 | (and path (file-name-nondirectory path)) | |
392 | path)))) |
|
392 | (if hg-running-xemacs | |
|
393 | (cons (quote 'hg-file-history) nil) | |||
|
394 | nil)))) | |||
|
395 | path)))) | |||
|
396 | ||||
|
397 | (defun hg-read-number (&optional prompt default) | |||
|
398 | "Read a integer value." | |||
|
399 | (save-excursion | |||
|
400 | (if (or (not default) current-prefix-arg) | |||
|
401 | (string-to-number | |||
|
402 | (eval (list* 'read-string | |||
|
403 | (or prompt "") | |||
|
404 | (if default (cons (format "%d" default) nil) nil)))) | |||
|
405 | default))) | |||
393 |
|
406 | |||
394 | (defun hg-read-config () |
|
407 | (defun hg-read-config () | |
395 | "Return an alist of (key . value) pairs of Mercurial config data. |
|
408 | "Return an alist of (key . value) pairs of Mercurial config data. | |
@@ -950,36 +963,55 b' With a prefix argument, prompt for the p' | |||||
950 | (kill-entire-line)) |
|
963 | (kill-entire-line)) | |
951 | (run-hooks 'hg-log-mode-hook)) |
|
964 | (run-hooks 'hg-log-mode-hook)) | |
952 |
|
965 | |||
953 | (defun hg-log (path &optional rev1 rev2) |
|
966 | (defun hg-log (path &optional rev1 rev2 log-limit) | |
954 |
"Display the revision history of PATH |
|
967 | "Display the revision history of PATH. | |
955 | REV1 defaults to hg-log-limit changes from the tip revision, while |
|
968 | History is displayed between REV1 and REV2. | |
956 | REV2 defaults to the tip. |
|
969 | Number of displayed changesets is limited to LOG-LIMIT. | |
|
970 | REV1 defaults to the tip, while | |||
|
971 | REV2 defaults to `hg-rev-completion-limit' changes from the tip revision. | |||
|
972 | LOG-LIMIT defaults to `hg-log-limit'. | |||
957 | With a prefix argument, prompt for each parameter." |
|
973 | With a prefix argument, prompt for each parameter." | |
958 | (interactive (list (hg-read-file-name " to log") |
|
974 | (interactive (list (hg-read-file-name " to log") | |
959 |
|
|
975 | (hg-read-rev " to start with" | |
960 | (hg-read-rev " to end with" (format "-%d" hg-log-limit)))) |
|
976 | "tip") | |
|
977 | (hg-read-rev " to end with" | |||
|
978 | (format "%d" (- hg-rev-completion-limit))) | |||
|
979 | (hg-read-number "Output limited to: " | |||
|
980 | hg-log-limit))) | |||
961 | (let ((a-path (hg-abbrev-file-name path)) |
|
981 | (let ((a-path (hg-abbrev-file-name path)) | |
962 |
|
|
982 | (r1 (or rev1 (format "-%d" hg-rev-completion-limit))) | |
963 |
|
|
983 | (r2 (or rev2 rev1 "tip")) | |
|
984 | (limit (format "%d" (or log-limit hg-log-limit)))) | |||
964 | (hg-view-output ((if (equal r1 r2) |
|
985 | (hg-view-output ((if (equal r1 r2) | |
965 |
|
|
986 | (format "Mercurial: Log of rev %s of %s" rev1 a-path) | |
966 | (format "Mercurial: Log from rev %s to %s of %s" |
|
987 | (format | |
967 | r1 r2 a-path))) |
|
988 | "Mercurial: at most %s log(s) from rev %s to %s of %s" | |
968 | (let ((revs (format "%s:%s" r1 r2))) |
|
989 | limit r1 r2 a-path))) | |
969 | (if (> (length path) (length (hg-root path))) |
|
990 | (eval (list* 'call-process (hg-binary) nil t nil | |
970 | (call-process (hg-binary) nil t nil "log" "-r" revs path) |
|
991 | "log" | |
971 | (call-process (hg-binary) nil t nil "log" "-r" revs))) |
|
992 | "-r" (format "%s:%s" r1 r2) | |
|
993 | "-l" limit | |||
|
994 | (if (> (length path) (length (hg-root path))) | |||
|
995 | (cons path nil) | |||
|
996 | nil))) | |||
972 | (hg-log-mode)))) |
|
997 | (hg-log-mode)))) | |
973 |
|
998 | |||
974 | (defun hg-log-repo (path &optional rev1 rev2) |
|
999 | (defun hg-log-repo (path &optional rev1 rev2 log-limit) | |
975 | "Display the revision history of the repository containing PATH. |
|
1000 | "Display the revision history of the repository containing PATH. | |
976 |
History is displayed between REV1 |
|
1001 | History is displayed between REV1 and REV2. | |
977 | REV2, which defaults to the initial revision. |
|
1002 | Number of displayed changesets is limited to LOG-LIMIT, | |
978 | Variable hg-log-limit controls the number of log entries displayed." |
|
1003 | REV1 defaults to the tip, while | |
|
1004 | REV2 defaults to `hg-rev-completion-limit' changes from the tip revision. | |||
|
1005 | LOG-LIMIT defaults to `hg-log-limit'. | |||
|
1006 | With a prefix argument, prompt for each parameter." | |||
979 | (interactive (list (hg-read-file-name " to log") |
|
1007 | (interactive (list (hg-read-file-name " to log") | |
980 |
|
|
1008 | (hg-read-rev " to start with" | |
981 | (hg-read-rev " to end with" (format "-%d" hg-log-limit)))) |
|
1009 | "tip") | |
982 | (hg-log (hg-root path) rev1 rev2)) |
|
1010 | (hg-read-rev " to end with" | |
|
1011 | (format "%d" (- hg-rev-completion-limit))) | |||
|
1012 | (hg-read-number "Output limited to: " | |||
|
1013 | hg-log-limit))) | |||
|
1014 | (hg-log (hg-root path) rev1 rev2 log-limit)) | |||
983 |
|
1015 | |||
984 | (defun hg-outgoing (&optional repo) |
|
1016 | (defun hg-outgoing (&optional repo) | |
985 | "Display changesets present locally that are not present in REPO." |
|
1017 | "Display changesets present locally that are not present in REPO." |
@@ -89,6 +89,16 b' hg' | |||||
89 | <p>This command should print a useful help message. If it does, |
|
89 | <p>This command should print a useful help message. If it does, | |
90 | other Mercurial commands should work fine for you.</p> |
|
90 | other Mercurial commands should work fine for you.</p> | |
91 |
|
91 | |||
|
92 | <h1>Configuration notes</h1> | |||
|
93 | <p>The default editor for commit messages is 'vi'. You can set the EDITOR | |||
|
94 | (or HGEDITOR) environment variable to specify your preference or set it in | |||
|
95 | mercurial.ini:</p> | |||
|
96 | <pre> | |||
|
97 | [ui] | |||
|
98 | editor = whatever | |||
|
99 | </pre> | |||
|
100 | ||||
|
101 | ||||
92 | <h1>Reporting problems</h1> |
|
102 | <h1>Reporting problems</h1> | |
93 |
|
103 | |||
94 | <p>Before you report any problems, please consult the <a |
|
104 | <p>Before you report any problems, please consult the <a |
@@ -36,11 +36,14 b' installed.' | |||||
36 | files override per-installation options. |
|
36 | files override per-installation options. | |
37 |
|
37 | |||
38 | (Unix) $HOME/.hgrc:: |
|
38 | (Unix) $HOME/.hgrc:: | |
39 | (Windows) C:\Documents and Settings\USERNAME\Mercurial.ini |
|
39 | (Windows) C:\Documents and Settings\USERNAME\Mercurial.ini:: | |
|
40 | (Windows) $HOME\Mercurial.ini:: | |||
40 | Per-user configuration file, for the user running Mercurial. |
|
41 | Per-user configuration file, for the user running Mercurial. | |
41 | Options in this file apply to all Mercurial commands executed by |
|
42 | Options in this file apply to all Mercurial commands executed by | |
42 | any user in any directory. Options in this file override |
|
43 | any user in any directory. Options in this file override | |
43 | per-installation and per-system options. |
|
44 | per-installation and per-system options. | |
|
45 | On Windows system, one of these is chosen exclusively according | |||
|
46 | to definition of HOME environment variable. | |||
44 |
|
47 | |||
45 | (Unix, Windows) <repo>/.hg/hgrc:: |
|
48 | (Unix, Windows) <repo>/.hg/hgrc:: | |
46 | Per-repository configuration options that only apply in a |
|
49 | Per-repository configuration options that only apply in a |
@@ -22,13 +22,16 b'' | |||||
22 | # |
|
22 | # | |
23 | # config items: |
|
23 | # config items: | |
24 | # |
|
24 | # | |
|
25 | # section name is 'bugzilla'. | |||
|
26 | # [bugzilla] | |||
|
27 | # | |||
25 | # REQUIRED: |
|
28 | # REQUIRED: | |
26 | # host = bugzilla # mysql server where bugzilla database lives |
|
29 | # host = bugzilla # mysql server where bugzilla database lives | |
27 | # password = ** # user's password |
|
30 | # password = ** # user's password | |
28 | # version = 2.16 # version of bugzilla installed |
|
31 | # version = 2.16 # version of bugzilla installed | |
29 | # |
|
32 | # | |
30 | # OPTIONAL: |
|
33 | # OPTIONAL: | |
31 |
# bzuser = ... # bugzilla user |
|
34 | # bzuser = ... # fallback bugzilla user name to record comments with | |
32 | # db = bugs # database to connect to |
|
35 | # db = bugs # database to connect to | |
33 | # notify = ... # command to run to get bugzilla to send mail |
|
36 | # notify = ... # command to run to get bugzilla to send mail | |
34 | # regexp = ... # regexp to match bug ids (must contain one "()" group) |
|
37 | # regexp = ... # regexp to match bug ids (must contain one "()" group) | |
@@ -39,6 +42,15 b'' | |||||
39 | # user = bugs # user to connect to database as |
|
42 | # user = bugs # user to connect to database as | |
40 | # [web] |
|
43 | # [web] | |
41 | # baseurl = http://hgserver/... # root of hg web site for browsing commits |
|
44 | # baseurl = http://hgserver/... # root of hg web site for browsing commits | |
|
45 | # | |||
|
46 | # if hg committer names are not same as bugzilla user names, use | |||
|
47 | # "usermap" feature to map from committer email to bugzilla user name. | |||
|
48 | # usermap can be in hgrc or separate config file. | |||
|
49 | # | |||
|
50 | # [bugzilla] | |||
|
51 | # usermap = filename # cfg file with "committer"="bugzilla user" info | |||
|
52 | # [usermap] | |||
|
53 | # committer_email = bugzilla_user_name | |||
42 |
|
54 | |||
43 | from mercurial.demandload import * |
|
55 | from mercurial.demandload import * | |
44 | from mercurial.i18n import gettext as _ |
|
56 | from mercurial.i18n import gettext as _ | |
@@ -60,6 +72,9 b' class bugzilla_2_16(object):' | |||||
60 | passwd = self.ui.config('bugzilla', 'password') |
|
72 | passwd = self.ui.config('bugzilla', 'password') | |
61 | db = self.ui.config('bugzilla', 'db', 'bugs') |
|
73 | db = self.ui.config('bugzilla', 'db', 'bugs') | |
62 | timeout = int(self.ui.config('bugzilla', 'timeout', 5)) |
|
74 | timeout = int(self.ui.config('bugzilla', 'timeout', 5)) | |
|
75 | usermap = self.ui.config('bugzilla', 'usermap') | |||
|
76 | if usermap: | |||
|
77 | self.ui.readconfig(usermap) | |||
63 | self.ui.note(_('connecting to %s:%s as %s, password %s\n') % |
|
78 | self.ui.note(_('connecting to %s:%s as %s, password %s\n') % | |
64 | (host, db, user, '*' * len(passwd))) |
|
79 | (host, db, user, '*' * len(passwd))) | |
65 | self.conn = MySQLdb.connect(host=host, user=user, passwd=passwd, |
|
80 | self.conn = MySQLdb.connect(host=host, user=user, passwd=passwd, | |
@@ -139,18 +154,29 b' class bugzilla_2_16(object):' | |||||
139 | self.user_ids[user] = userid |
|
154 | self.user_ids[user] = userid | |
140 | return userid |
|
155 | return userid | |
141 |
|
156 | |||
142 |
def |
|
157 | def map_committer(self, user): | |
|
158 | '''map name of committer to bugzilla user name.''' | |||
|
159 | for committer, bzuser in self.ui.configitems('usermap'): | |||
|
160 | if committer.lower() == user.lower(): | |||
|
161 | return bzuser | |||
|
162 | return user | |||
|
163 | ||||
|
164 | def add_comment(self, bugid, text, committer): | |||
143 | '''add comment to bug. try adding comment as committer of |
|
165 | '''add comment to bug. try adding comment as committer of | |
144 | changeset, otherwise as default bugzilla user.''' |
|
166 | changeset, otherwise as default bugzilla user.''' | |
|
167 | user = self.map_committer(committer) | |||
145 | try: |
|
168 | try: | |
146 |
userid = self.get_user_id( |
|
169 | userid = self.get_user_id(user) | |
147 | except KeyError: |
|
170 | except KeyError: | |
148 | try: |
|
171 | try: | |
149 | defaultuser = self.ui.config('bugzilla', 'bzuser') |
|
172 | defaultuser = self.ui.config('bugzilla', 'bzuser') | |
|
173 | if not defaultuser: | |||
|
174 | raise util.Abort(_('cannot find bugzilla user id for %s') % | |||
|
175 | user) | |||
150 | userid = self.get_user_id(defaultuser) |
|
176 | userid = self.get_user_id(defaultuser) | |
151 | except KeyError: |
|
177 | except KeyError: | |
152 | raise util.Abort(_('cannot find user id for %s or %s') % |
|
178 | raise util.Abort(_('cannot find bugzilla user id for %s or %s') % | |
153 |
( |
|
179 | (user, defaultuser)) | |
154 | now = time.strftime('%Y-%m-%d %H:%M:%S') |
|
180 | now = time.strftime('%Y-%m-%d %H:%M:%S') | |
155 | self.run('''insert into longdescs |
|
181 | self.run('''insert into longdescs | |
156 | (bug_id, who, bug_when, thetext) |
|
182 | (bug_id, who, bug_when, thetext) |
@@ -173,7 +173,7 b' class bisect(object):' | |||||
173 | self.ui.warn("Could not find the first bad revision\n") |
|
173 | self.ui.warn("Could not find the first bad revision\n") | |
174 | sys.exit(1) |
|
174 | sys.exit(1) | |
175 | self.ui.write( |
|
175 | self.ui.write( | |
176 |
"The first bad revision is |
|
176 | "The first bad revision is: %s\n" % hg.hex(self.badrev)) | |
177 | sys.exit(0) |
|
177 | sys.exit(0) | |
178 | self.ui.write("%d revisions left\n" % tot) |
|
178 | self.ui.write("%d revisions left\n" % tot) | |
179 | best_rev = None |
|
179 | best_rev = None |
@@ -102,6 +102,7 b' class queue:' | |||||
102 | message = [] |
|
102 | message = [] | |
103 | comments = [] |
|
103 | comments = [] | |
104 | user = None |
|
104 | user = None | |
|
105 | date = None | |||
105 | format = None |
|
106 | format = None | |
106 | subject = None |
|
107 | subject = None | |
107 | diffstart = 0 |
|
108 | diffstart = 0 | |
@@ -119,6 +120,8 b' class queue:' | |||||
119 | # parse values when importing the result of an hg export |
|
120 | # parse values when importing the result of an hg export | |
120 | if line.startswith("# User "): |
|
121 | if line.startswith("# User "): | |
121 | user = line[7:] |
|
122 | user = line[7:] | |
|
123 | elif line.startswith("# Date "): | |||
|
124 | date = line[7:] | |||
122 | elif not line.startswith("# ") and line: |
|
125 | elif not line.startswith("# ") and line: | |
123 | message.append(line) |
|
126 | message.append(line) | |
124 | format = None |
|
127 | format = None | |
@@ -136,7 +139,7 b' class queue:' | |||||
136 | # when looking for tags (subject: from: etc) they |
|
139 | # when looking for tags (subject: from: etc) they | |
137 | # end once you find a blank line in the source |
|
140 | # end once you find a blank line in the source | |
138 | format = "tagdone" |
|
141 | format = "tagdone" | |
139 | else: |
|
142 | elif message or line: | |
140 | message.append(line) |
|
143 | message.append(line) | |
141 | comments.append(line) |
|
144 | comments.append(line) | |
142 |
|
145 | |||
@@ -149,7 +152,7 b' class queue:' | |||||
149 | if format and format.startswith("tag") and subject: |
|
152 | if format and format.startswith("tag") and subject: | |
150 | message.insert(0, "") |
|
153 | message.insert(0, "") | |
151 | message.insert(0, subject) |
|
154 | message.insert(0, subject) | |
152 | return (message, comments, user, diffstart > 1) |
|
155 | return (message, comments, user, date, diffstart > 1) | |
153 |
|
156 | |||
154 | def mergeone(self, repo, mergeq, head, patch, rev, wlock): |
|
157 | def mergeone(self, repo, mergeq, head, patch, rev, wlock): | |
155 | # first try just applying the patch |
|
158 | # first try just applying the patch | |
@@ -179,7 +182,7 b' class queue:' | |||||
179 | self.ui.warn("repo commit failed\n") |
|
182 | self.ui.warn("repo commit failed\n") | |
180 | sys.exit(1) |
|
183 | sys.exit(1) | |
181 | try: |
|
184 | try: | |
182 | message, comments, user, patchfound = mergeq.readheaders(patch) |
|
185 | message, comments, user, date, patchfound = mergeq.readheaders(patch) | |
183 | except: |
|
186 | except: | |
184 | self.ui.warn("Unable to read %s\n" % patch) |
|
187 | self.ui.warn("Unable to read %s\n" % patch) | |
185 | sys.exit(1) |
|
188 | sys.exit(1) | |
@@ -267,7 +270,7 b' class queue:' | |||||
267 | pf = os.path.join(patchdir, patch) |
|
270 | pf = os.path.join(patchdir, patch) | |
268 |
|
271 | |||
269 | try: |
|
272 | try: | |
270 | message, comments, user, patchfound = self.readheaders(patch) |
|
273 | message, comments, user, date, patchfound = self.readheaders(patch) | |
271 | except: |
|
274 | except: | |
272 | self.ui.warn("Unable to read %s\n" % pf) |
|
275 | self.ui.warn("Unable to read %s\n" % pf) | |
273 | err = 1 |
|
276 | err = 1 | |
@@ -326,7 +329,7 b' class queue:' | |||||
326 | if len(files) > 0: |
|
329 | if len(files) > 0: | |
327 | commands.addremove_lock(self.ui, repo, files, |
|
330 | commands.addremove_lock(self.ui, repo, files, | |
328 | opts={}, wlock=wlock) |
|
331 | opts={}, wlock=wlock) | |
329 | n = repo.commit(files, message, user, force=1, lock=lock, |
|
332 | n = repo.commit(files, message, user, date, force=1, lock=lock, | |
330 | wlock=wlock) |
|
333 | wlock=wlock) | |
331 |
|
334 | |||
332 | if n == None: |
|
335 | if n == None: | |
@@ -716,7 +719,7 b' class queue:' | |||||
716 | top = revlog.bin(top) |
|
719 | top = revlog.bin(top) | |
717 | cparents = repo.changelog.parents(top) |
|
720 | cparents = repo.changelog.parents(top) | |
718 | patchparent = self.qparents(repo, top) |
|
721 | patchparent = self.qparents(repo, top) | |
719 | message, comments, user, patchfound = self.readheaders(patch) |
|
722 | message, comments, user, date, patchfound = self.readheaders(patch) | |
720 |
|
723 | |||
721 | patchf = self.opener(patch, "w") |
|
724 | patchf = self.opener(patch, "w") | |
722 | if comments: |
|
725 | if comments: |
@@ -1392,6 +1392,7 b' def doexport(ui, repo, changeset, seqno,' | |||||
1392 |
|
1392 | |||
1393 | fp.write("# HG changeset patch\n") |
|
1393 | fp.write("# HG changeset patch\n") | |
1394 | fp.write("# User %s\n" % change[1]) |
|
1394 | fp.write("# User %s\n" % change[1]) | |
|
1395 | fp.write("# Date %d %d\n" % change[2]) | |||
1395 | fp.write("# Node ID %s\n" % hex(node)) |
|
1396 | fp.write("# Node ID %s\n" % hex(node)) | |
1396 | fp.write("# Parent %s\n" % hex(prev)) |
|
1397 | fp.write("# Parent %s\n" % hex(prev)) | |
1397 | if len(parents) > 1: |
|
1398 | if len(parents) > 1: | |
@@ -1687,6 +1688,7 b' def import_(ui, repo, patch1, *patches, ' | |||||
1687 |
|
1688 | |||
1688 | message = [] |
|
1689 | message = [] | |
1689 | user = None |
|
1690 | user = None | |
|
1691 | date = None | |||
1690 | hgpatch = False |
|
1692 | hgpatch = False | |
1691 | for line in file(pf): |
|
1693 | for line in file(pf): | |
1692 | line = line.rstrip() |
|
1694 | line = line.rstrip() | |
@@ -1703,27 +1705,29 b' def import_(ui, repo, patch1, *patches, ' | |||||
1703 | if line.startswith("# User "): |
|
1705 | if line.startswith("# User "): | |
1704 | user = line[7:] |
|
1706 | user = line[7:] | |
1705 | ui.debug(_('User: %s\n') % user) |
|
1707 | ui.debug(_('User: %s\n') % user) | |
|
1708 | elif line.startswith("# Date "): | |||
|
1709 | date = line[7:] | |||
1706 | elif not line.startswith("# ") and line: |
|
1710 | elif not line.startswith("# ") and line: | |
1707 | message.append(line) |
|
1711 | message.append(line) | |
1708 | hgpatch = False |
|
1712 | hgpatch = False | |
1709 | elif line == '# HG changeset patch': |
|
1713 | elif line == '# HG changeset patch': | |
1710 | hgpatch = True |
|
1714 | hgpatch = True | |
1711 | message = [] # We may have collected garbage |
|
1715 | message = [] # We may have collected garbage | |
1712 | else: |
|
1716 | elif message or line: | |
1713 | message.append(line) |
|
1717 | message.append(line) | |
1714 |
|
1718 | |||
1715 | # make sure message isn't empty |
|
1719 | # make sure message isn't empty | |
1716 | if not message: |
|
1720 | if not message: | |
1717 | message = _("imported patch %s\n") % patch |
|
1721 | message = _("imported patch %s\n") % patch | |
1718 | else: |
|
1722 | else: | |
1719 |
message = |
|
1723 | message = '\n'.join(message).rstrip() | |
1720 | ui.debug(_('message:\n%s\n') % message) |
|
1724 | ui.debug(_('message:\n%s\n') % message) | |
1721 |
|
1725 | |||
1722 | files = util.patch(strip, pf, ui) |
|
1726 | files = util.patch(strip, pf, ui) | |
1723 |
|
1727 | |||
1724 | if len(files) > 0: |
|
1728 | if len(files) > 0: | |
1725 | addremove_lock(ui, repo, files, {}) |
|
1729 | addremove_lock(ui, repo, files, {}) | |
1726 | repo.commit(files, message, user) |
|
1730 | repo.commit(files, message, user, date) | |
1727 |
|
1731 | |||
1728 | def incoming(ui, repo, source="default", **opts): |
|
1732 | def incoming(ui, repo, source="default", **opts): | |
1729 | """show new changesets found in source |
|
1733 | """show new changesets found in source | |
@@ -2185,34 +2189,42 b' def remove(ui, repo, *pats, **opts):' | |||||
2185 | entire project history. If the files still exist in the working |
|
2189 | entire project history. If the files still exist in the working | |
2186 | directory, they will be deleted from it. If invoked with --after, |
|
2190 | directory, they will be deleted from it. If invoked with --after, | |
2187 | files that have been manually deleted are marked as removed. |
|
2191 | files that have been manually deleted are marked as removed. | |
|
2192 | ||||
|
2193 | Modified files and added files are not removed by default. To | |||
|
2194 | remove them, use the -f/--force option. | |||
2188 | """ |
|
2195 | """ | |
2189 | names = [] |
|
2196 | names = [] | |
2190 | if not opts['after'] and not pats: |
|
2197 | if not opts['after'] and not pats: | |
2191 | raise util.Abort(_('no files specified')) |
|
2198 | raise util.Abort(_('no files specified')) | |
2192 | def okaytoremove(abs, rel, exact): |
|
2199 | files, matchfn, anypats = matchpats(repo, pats, opts) | |
2193 | modified, added, removed, deleted, unknown = repo.changes(files=[abs]) |
|
2200 | exact = dict.fromkeys(files) | |
|
2201 | mardu = map(dict.fromkeys, repo.changes(files=files, match=matchfn)) | |||
|
2202 | modified, added, removed, deleted, unknown = mardu | |||
|
2203 | remove, forget = [], [] | |||
|
2204 | for src, abs, rel, exact in walk(repo, pats, opts): | |||
2194 | reason = None |
|
2205 | reason = None | |
2195 | if not deleted and opts['after']: |
|
2206 | if abs not in deleted and opts['after']: | |
2196 | reason = _('is still present') |
|
2207 | reason = _('is still present') | |
2197 | elif modified and not opts['force']: |
|
2208 | elif abs in modified and not opts['force']: | |
2198 | reason = _('is modified') |
|
2209 | reason = _('is modified (use -f to force removal)') | |
2199 | elif added: |
|
2210 | elif abs in added: | |
2200 | reason = _('has been marked for add') |
|
2211 | if opts['force']: | |
2201 | elif unknown: |
|
2212 | forget.append(abs) | |
|
2213 | continue | |||
|
2214 | reason = _('has been marked for add (use -f to force removal)') | |||
|
2215 | elif abs in unknown: | |||
2202 | reason = _('is not managed') |
|
2216 | reason = _('is not managed') | |
2203 | elif removed: |
|
2217 | elif abs in removed: | |
2204 | return False |
|
2218 | continue | |
2205 | if reason: |
|
2219 | if reason: | |
2206 | if exact: |
|
2220 | if exact: | |
2207 | ui.warn(_('not removing %s: file %s\n') % (rel, reason)) |
|
2221 | ui.warn(_('not removing %s: file %s\n') % (rel, reason)) | |
2208 | else: |
|
2222 | else: | |
2209 | return True |
|
|||
2210 | for src, abs, rel, exact in walk(repo, pats, opts): |
|
|||
2211 | if okaytoremove(abs, rel, exact): |
|
|||
2212 | if ui.verbose or not exact: |
|
2223 | if ui.verbose or not exact: | |
2213 | ui.status(_('removing %s\n') % rel) |
|
2224 | ui.status(_('removing %s\n') % rel) | |
2214 |
|
|
2225 | remove.append(abs) | |
2215 | repo.remove(names, unlink=not opts['after']) |
|
2226 | repo.forget(forget) | |
|
2227 | repo.remove(remove, unlink=not opts['after']) | |||
2216 |
|
2228 | |||
2217 | def rename(ui, repo, *pats, **opts): |
|
2229 | def rename(ui, repo, *pats, **opts): | |
2218 | """rename files; equivalent of copy + remove |
|
2230 | """rename files; equivalent of copy + remove |
@@ -81,6 +81,10 b' class _replacer_from(_replacer):' | |||||
81 |
|
81 | |||
82 | return getattr(importer.module(), target) |
|
82 | return getattr(importer.module(), target) | |
83 |
|
83 | |||
|
84 | def __call__(self, *args, **kwargs): | |||
|
85 | target = object.__getattribute__(self, 'module')() | |||
|
86 | return target(*args, **kwargs) | |||
|
87 | ||||
84 | def demandload(scope, modules): |
|
88 | def demandload(scope, modules): | |
85 | '''import modules into scope when each is first used. |
|
89 | '''import modules into scope when each is first used. | |
86 |
|
90 |
@@ -8,12 +8,12 b'' | |||||
8 |
|
8 | |||
9 | import os, cgi, sys |
|
9 | import os, cgi, sys | |
10 | import mimetypes |
|
10 | import mimetypes | |
11 | from demandload import demandload |
|
11 | from mercurial.demandload import demandload | |
12 |
demandload(globals(), " |
|
12 | demandload(globals(), "time re socket zlib errno ConfigParser tempfile") | |
13 |
demandload(globals(), " |
|
13 | demandload(globals(), "StringIO BaseHTTPServer SocketServer urllib") | |
14 |
demandload(globals(), " |
|
14 | demandload(globals(), "mercurial:mdiff,ui,hg,util,archival,templater") | |
15 | from node import * |
|
15 | from mercurial.node import * | |
16 | from i18n import gettext as _ |
|
16 | from mercurial.i18n import gettext as _ | |
17 |
|
17 | |||
18 | def splitURI(uri): |
|
18 | def splitURI(uri): | |
19 | """ Return path and query splited from uri |
|
19 | """ Return path and query splited from uri |
@@ -166,37 +166,44 b' class localrepository(object):' | |||||
166 | return |
|
166 | return | |
167 | s = l.split(" ", 1) |
|
167 | s = l.split(" ", 1) | |
168 | if len(s) != 2: |
|
168 | if len(s) != 2: | |
169 |
self.ui.warn(_("%s: |
|
169 | self.ui.warn(_("%s: cannot parse entry\n") % context) | |
170 | return |
|
170 | return | |
171 | node, key = s |
|
171 | node, key = s | |
|
172 | key = key.strip() | |||
172 | try: |
|
173 | try: | |
173 | bin_n = bin(node) |
|
174 | bin_n = bin(node) | |
174 | except TypeError: |
|
175 | except TypeError: | |
175 |
self.ui.warn(_("%s: |
|
176 | self.ui.warn(_("%s: node '%s' is not well formed\n") % | |
|
177 | (context, node)) | |||
176 | return |
|
178 | return | |
177 | if bin_n not in self.changelog.nodemap: |
|
179 | if bin_n not in self.changelog.nodemap: | |
178 |
self.ui.warn(_("%s: |
|
180 | self.ui.warn(_("%s: tag '%s' refers to unknown node\n") % | |
|
181 | (context, key)) | |||
179 | return |
|
182 | return | |
180 |
self.tagscache[key |
|
183 | self.tagscache[key] = bin_n | |
181 |
|
184 | |||
182 |
# read |
|
185 | # read the tags file from each head, ending with the tip, | |
183 | # and add each tag found to the map, with "newer" ones |
|
186 | # and add each tag found to the map, with "newer" ones | |
184 | # taking precedence |
|
187 | # taking precedence | |
|
188 | heads = self.heads() | |||
|
189 | heads.reverse() | |||
185 | fl = self.file(".hgtags") |
|
190 | fl = self.file(".hgtags") | |
186 |
|
|
191 | for node in heads: | |
187 | h.reverse() |
|
192 | change = self.changelog.read(node) | |
188 | for r in h: |
|
193 | rev = self.changelog.rev(node) | |
|
194 | fn, ff = self.manifest.find(change[0], '.hgtags') | |||
|
195 | if fn is None: continue | |||
189 | count = 0 |
|
196 | count = 0 | |
190 |
for l in fl.read( |
|
197 | for l in fl.read(fn).splitlines(): | |
191 | count += 1 |
|
198 | count += 1 | |
192 |
parsetag(l, ".hgtags:%d" % |
|
199 | parsetag(l, _(".hgtags (rev %d:%s), line %d") % | |
193 |
|
200 | (rev, short(node), count)) | ||
194 | try: |
|
201 | try: | |
195 | f = self.opener("localtags") |
|
202 | f = self.opener("localtags") | |
196 | count = 0 |
|
203 | count = 0 | |
197 | for l in f: |
|
204 | for l in f: | |
198 | count += 1 |
|
205 | count += 1 | |
199 |
parsetag(l, "localtags |
|
206 | parsetag(l, _("localtags, line %d") % count) | |
200 | except IOError: |
|
207 | except IOError: | |
201 | pass |
|
208 | pass | |
202 |
|
209 | |||
@@ -550,12 +557,15 b' class localrepository(object):' | |||||
550 | # run editor in the repository root |
|
557 | # run editor in the repository root | |
551 | olddir = os.getcwd() |
|
558 | olddir = os.getcwd() | |
552 | os.chdir(self.root) |
|
559 | os.chdir(self.root) | |
553 |
|
|
560 | text = self.ui.edit("\n".join(edittext), user) | |
554 | os.chdir(olddir) |
|
561 | os.chdir(olddir) | |
555 | if not edittext.rstrip(): |
|
|||
556 | return None |
|
|||
557 | text = edittext |
|
|||
558 |
|
562 | |||
|
563 | lines = [line.rstrip() for line in text.rstrip().splitlines()] | |||
|
564 | while lines and not lines[0]: | |||
|
565 | del lines[0] | |||
|
566 | if not lines: | |||
|
567 | return None | |||
|
568 | text = '\n'.join(lines) | |||
559 | n = self.changelog.add(mn, changed + remove, text, tr, p1, p2, user, date) |
|
569 | n = self.changelog.add(mn, changed + remove, text, tr, p1, p2, user, date) | |
560 | self.hook('pretxncommit', throw=True, node=hex(n), parent1=xp1, |
|
570 | self.hook('pretxncommit', throw=True, node=hex(n), parent1=xp1, | |
561 | parent2=xp2) |
|
571 | parent2=xp2) |
@@ -43,48 +43,61 b' class manifest(revlog):' | |||||
43 | def diff(self, a, b): |
|
43 | def diff(self, a, b): | |
44 | return mdiff.textdiff(str(a), str(b)) |
|
44 | return mdiff.textdiff(str(a), str(b)) | |
45 |
|
45 | |||
|
46 | def _search(self, m, s, lo=0, hi=None): | |||
|
47 | '''return a tuple (start, end) that says where to find s within m. | |||
|
48 | ||||
|
49 | If the string is found m[start:end] are the line containing | |||
|
50 | that string. If start == end the string was not found and | |||
|
51 | they indicate the proper sorted insertion point. This was | |||
|
52 | taken from bisect_left, and modified to find line start/end as | |||
|
53 | it goes along. | |||
|
54 | ||||
|
55 | m should be a buffer or a string | |||
|
56 | s is a string''' | |||
|
57 | def advance(i, c): | |||
|
58 | while i < lenm and m[i] != c: | |||
|
59 | i += 1 | |||
|
60 | return i | |||
|
61 | lenm = len(m) | |||
|
62 | if not hi: | |||
|
63 | hi = lenm | |||
|
64 | while lo < hi: | |||
|
65 | mid = (lo + hi) // 2 | |||
|
66 | start = mid | |||
|
67 | while start > 0 and m[start-1] != '\n': | |||
|
68 | start -= 1 | |||
|
69 | end = advance(start, '\0') | |||
|
70 | if m[start:end] < s: | |||
|
71 | # we know that after the null there are 40 bytes of sha1 | |||
|
72 | # this translates to the bisect lo = mid + 1 | |||
|
73 | lo = advance(end + 40, '\n') + 1 | |||
|
74 | else: | |||
|
75 | # this translates to the bisect hi = mid | |||
|
76 | hi = start | |||
|
77 | end = advance(lo, '\0') | |||
|
78 | found = m[lo:end] | |||
|
79 | if cmp(s, found) == 0: | |||
|
80 | # we know that after the null there are 40 bytes of sha1 | |||
|
81 | end = advance(end + 40, '\n') | |||
|
82 | return (lo, end+1) | |||
|
83 | else: | |||
|
84 | return (lo, lo) | |||
|
85 | ||||
|
86 | def find(self, node, f): | |||
|
87 | '''look up entry for a single file efficiently. | |||
|
88 | return (node, flag) pair if found, (None, None) if not.''' | |||
|
89 | if self.mapcache and node == self.mapcache[0]: | |||
|
90 | return self.mapcache[1].get(f), self.mapcache[2].get(f) | |||
|
91 | text = self.revision(node) | |||
|
92 | start, end = self._search(text, f) | |||
|
93 | if start == end: | |||
|
94 | return None, None | |||
|
95 | l = text[start:end] | |||
|
96 | f, n = l.split('\0') | |||
|
97 | return bin(n[:40]), n[40:-1] == 'x' | |||
|
98 | ||||
46 | def add(self, map, flags, transaction, link, p1=None, p2=None, |
|
99 | def add(self, map, flags, transaction, link, p1=None, p2=None, | |
47 | changed=None): |
|
100 | changed=None): | |
48 |
|
||||
49 | # returns a tuple (start, end). If the string is found |
|
|||
50 | # m[start:end] are the line containing that string. If start == end |
|
|||
51 | # the string was not found and they indicate the proper sorted |
|
|||
52 | # insertion point. This was taken from bisect_left, and modified |
|
|||
53 | # to find line start/end as it goes along. |
|
|||
54 | # |
|
|||
55 | # m should be a buffer or a string |
|
|||
56 | # s is a string |
|
|||
57 | # |
|
|||
58 | def manifestsearch(m, s, lo=0, hi=None): |
|
|||
59 | def advance(i, c): |
|
|||
60 | while i < lenm and m[i] != c: |
|
|||
61 | i += 1 |
|
|||
62 | return i |
|
|||
63 | lenm = len(m) |
|
|||
64 | if not hi: |
|
|||
65 | hi = lenm |
|
|||
66 | while lo < hi: |
|
|||
67 | mid = (lo + hi) // 2 |
|
|||
68 | start = mid |
|
|||
69 | while start > 0 and m[start-1] != '\n': |
|
|||
70 | start -= 1 |
|
|||
71 | end = advance(start, '\0') |
|
|||
72 | if m[start:end] < s: |
|
|||
73 | # we know that after the null there are 40 bytes of sha1 |
|
|||
74 | # this translates to the bisect lo = mid + 1 |
|
|||
75 | lo = advance(end + 40, '\n') + 1 |
|
|||
76 | else: |
|
|||
77 | # this translates to the bisect hi = mid |
|
|||
78 | hi = start |
|
|||
79 | end = advance(lo, '\0') |
|
|||
80 | found = m[lo:end] |
|
|||
81 | if cmp(s, found) == 0: |
|
|||
82 | # we know that after the null there are 40 bytes of sha1 |
|
|||
83 | end = advance(end + 40, '\n') |
|
|||
84 | return (lo, end+1) |
|
|||
85 | else: |
|
|||
86 | return (lo, lo) |
|
|||
87 |
|
||||
88 | # apply the changes collected during the bisect loop to our addlist |
|
101 | # apply the changes collected during the bisect loop to our addlist | |
89 | # return a delta suitable for addrevision |
|
102 | # return a delta suitable for addrevision | |
90 | def addlistdelta(addlist, x): |
|
103 | def addlistdelta(addlist, x): | |
@@ -137,7 +150,7 b' class manifest(revlog):' | |||||
137 | for w in work: |
|
150 | for w in work: | |
138 | f = w[0] |
|
151 | f = w[0] | |
139 | # bs will either be the index of the item or the insert point |
|
152 | # bs will either be the index of the item or the insert point | |
140 |
start, end = |
|
153 | start, end = self._search(addbuf, f, start) | |
141 | if w[1] == 0: |
|
154 | if w[1] == 0: | |
142 | l = "%s\000%s%s\n" % (f, hex(map[f]), |
|
155 | l = "%s\000%s%s\n" % (f, hex(map[f]), | |
143 | flags[f] and "x" or '') |
|
156 | flags[f] and "x" or '') |
@@ -94,7 +94,7 b' def patch(strip, patchname, ui):' | |||||
94 | """apply the patch <patchname> to the working directory. |
|
94 | """apply the patch <patchname> to the working directory. | |
95 | a list of patched files is returned""" |
|
95 | a list of patched files is returned""" | |
96 | patcher = find_in_path('gpatch', os.environ.get('PATH', ''), 'patch') |
|
96 | patcher = find_in_path('gpatch', os.environ.get('PATH', ''), 'patch') | |
97 |
fp = os.popen(' |
|
97 | fp = os.popen('%s -p%d < "%s"' % (patcher, strip, patchname)) | |
98 | files = {} |
|
98 | files = {} | |
99 | for line in fp: |
|
99 | for line in fp: | |
100 | line = line.rstrip() |
|
100 | line = line.rstrip() | |
@@ -734,7 +734,7 b' def opener(base, audit=True):' | |||||
734 | def rename(self): |
|
734 | def rename(self): | |
735 | if not self.closed: |
|
735 | if not self.closed: | |
736 | posixfile.close(self) |
|
736 | posixfile.close(self) | |
737 | rename(self.temp, self.__name) |
|
737 | rename(self.temp, localpath(self.__name)) | |
738 | def __del__(self): |
|
738 | def __del__(self): | |
739 | if not self.closed: |
|
739 | if not self.closed: | |
740 | try: |
|
740 | try: |
@@ -194,7 +194,7 b' def user_rcpath():' | |||||
194 | # We are on win < nt: fetch the APPDATA directory location and use |
|
194 | # We are on win < nt: fetch the APPDATA directory location and use | |
195 | # the parent directory as the user home dir. |
|
195 | # the parent directory as the user home dir. | |
196 | appdir = shell.SHGetPathFromIDList( |
|
196 | appdir = shell.SHGetPathFromIDList( | |
197 |
|
|
197 | shell.SHGetSpecialFolderLocation(0, shellcon.CSIDL_APPDATA)) | |
198 | userdir = os.path.dirname(appdir) |
|
198 | userdir = os.path.dirname(appdir) | |
199 | return os.path.join(userdir, 'mercurial.ini') |
|
199 | return os.path.join(userdir, 'mercurial.ini') | |
200 |
|
200 |
@@ -56,6 +56,7 b' try:' | |||||
56 | else: |
|
56 | else: | |
57 | self.includes = self.includes.split(',') |
|
57 | self.includes = self.includes.split(',') | |
58 | mercurial.packagescan.scan(self.build_lib,'mercurial') |
|
58 | mercurial.packagescan.scan(self.build_lib,'mercurial') | |
|
59 | mercurial.packagescan.scan(self.build_lib,'mercurial/hgweb') | |||
59 | mercurial.packagescan.scan(self.build_lib,'hgext') |
|
60 | mercurial.packagescan.scan(self.build_lib,'hgext') | |
60 | self.includes += mercurial.packagescan.getmodules() |
|
61 | self.includes += mercurial.packagescan.getmodules() | |
61 | build_exe.finalize_options(self) |
|
62 | build_exe.finalize_options(self) | |
@@ -85,7 +86,7 b" setup(name='mercurial'," | |||||
85 | url='http://selenic.com/mercurial', |
|
86 | url='http://selenic.com/mercurial', | |
86 | description='Scalable distributed SCM', |
|
87 | description='Scalable distributed SCM', | |
87 | license='GNU GPL', |
|
88 | license='GNU GPL', | |
88 | packages=['mercurial', 'hgext'], |
|
89 | packages=['mercurial', 'mercurial.hgweb', 'hgext'], | |
89 | ext_modules=[Extension('mercurial.mpatch', ['mercurial/mpatch.c']), |
|
90 | ext_modules=[Extension('mercurial.mpatch', ['mercurial/mpatch.c']), | |
90 | Extension('mercurial.bdiff', ['mercurial/bdiff.c'])], |
|
91 | Extension('mercurial.bdiff', ['mercurial/bdiff.c'])], | |
91 | data_files=[('mercurial/templates', |
|
92 | data_files=[('mercurial/templates', |
@@ -1,19 +1,19 b'' | |||||
1 | # basic operation |
|
1 | # basic operation | |
2 | adding a |
|
2 | adding a | |
3 |
changeset 2: |
|
3 | changeset 2:b38a34ddfd9f backs out changeset 1:a820f4f40a57 | |
4 | a |
|
4 | a | |
5 | # file that was removed is recreated |
|
5 | # file that was removed is recreated | |
6 | adding a |
|
6 | adding a | |
7 | adding a |
|
7 | adding a | |
8 |
changeset 2: |
|
8 | changeset 2:44cd84c7349a backs out changeset 1:76862dcce372 | |
9 | content |
|
9 | content | |
10 | # backout of backout is as if nothing happened |
|
10 | # backout of backout is as if nothing happened | |
11 | removing a |
|
11 | removing a | |
12 |
changeset 3: |
|
12 | changeset 3:0dd8a0ed5e99 backs out changeset 2:44cd84c7349a | |
13 | cat: a: No such file or directory |
|
13 | cat: a: No such file or directory | |
14 | # backout with merge |
|
14 | # backout with merge | |
15 | adding a |
|
15 | adding a | |
16 |
changeset 3: |
|
16 | changeset 3:6c77ecc28460 backs out changeset 1:314f55b1bf23 | |
17 | merging with changeset 2:b66ea5b77abb |
|
17 | merging with changeset 2:b66ea5b77abb | |
18 | merging a |
|
18 | merging a | |
19 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
19 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
@@ -6,40 +6,40 b' 29a31' | |||||
6 | 43a46 |
|
6 | 43a46 | |
7 | > files: |
|
7 | > files: | |
8 | # compact style works |
|
8 | # compact style works | |
9 |
3[tip] |
|
9 | 3[tip] 10e46f2dcbf4 1970-01-16 01:06 +0000 person | |
10 | no user, no domain |
|
10 | no user, no domain | |
11 |
|
11 | |||
12 |
2 |
|
12 | 2 97054abb4ab8 1970-01-14 21:20 +0000 other | |
13 | no person |
|
13 | no person | |
14 |
|
14 | |||
15 |
1 |
|
15 | 1 b608e9d1a3f0 1970-01-13 17:33 +0000 other | |
16 | other 1 |
|
16 | other 1 | |
17 |
|
17 | |||
18 |
0 |
|
18 | 0 1e4e1b8f71e0 1970-01-12 13:46 +0000 user | |
19 | line 1 |
|
19 | line 1 | |
20 |
|
20 | |||
21 |
3[tip] |
|
21 | 3[tip] 10e46f2dcbf4 1970-01-16 01:06 +0000 person | |
22 | no user, no domain |
|
22 | no user, no domain | |
23 |
|
23 | |||
24 |
2 |
|
24 | 2 97054abb4ab8 1970-01-14 21:20 +0000 other | |
25 | no person |
|
25 | no person | |
26 |
|
26 | |||
27 |
1 |
|
27 | 1 b608e9d1a3f0 1970-01-13 17:33 +0000 other | |
28 | other 1 |
|
28 | other 1 | |
29 |
|
29 | |||
30 |
0 |
|
30 | 0 1e4e1b8f71e0 1970-01-12 13:46 +0000 user | |
31 | line 1 |
|
31 | line 1 | |
32 |
|
32 | |||
33 |
3[tip]:2,-1 |
|
33 | 3[tip]:2,-1 10e46f2dcbf4 1970-01-16 01:06 +0000 person | |
34 | no user, no domain |
|
34 | no user, no domain | |
35 |
|
35 | |||
36 |
2:1,-1 |
|
36 | 2:1,-1 97054abb4ab8 1970-01-14 21:20 +0000 other | |
37 | no person |
|
37 | no person | |
38 |
|
38 | |||
39 |
1:0,-1 |
|
39 | 1:0,-1 b608e9d1a3f0 1970-01-13 17:33 +0000 other | |
40 | other 1 |
|
40 | other 1 | |
41 |
|
41 | |||
42 |
0:-1,-1 |
|
42 | 0:-1,-1 1e4e1b8f71e0 1970-01-12 13:46 +0000 user | |
43 | line 1 |
|
43 | line 1 | |
44 |
|
44 | |||
45 | # error if style not readable |
|
45 | # error if style not readable | |
@@ -103,30 +103,24 b' desc: other 1' | |||||
103 | other 2 |
|
103 | other 2 | |
104 |
|
104 | |||
105 | other 3 |
|
105 | other 3 | |
106 |
|
||||
107 | desc: line 1 |
|
106 | desc: line 1 | |
108 | line 2 |
|
107 | line 2 | |
109 |
|
||||
110 | desc--verbose: no user, no domain |
|
108 | desc--verbose: no user, no domain | |
111 | desc--verbose: no person |
|
109 | desc--verbose: no person | |
112 | desc--verbose: other 1 |
|
110 | desc--verbose: other 1 | |
113 | other 2 |
|
111 | other 2 | |
114 |
|
112 | |||
115 | other 3 |
|
113 | other 3 | |
116 |
|
||||
117 | desc--verbose: line 1 |
|
114 | desc--verbose: line 1 | |
118 | line 2 |
|
115 | line 2 | |
119 |
|
||||
120 | desc--debug: no user, no domain |
|
116 | desc--debug: no user, no domain | |
121 | desc--debug: no person |
|
117 | desc--debug: no person | |
122 | desc--debug: other 1 |
|
118 | desc--debug: other 1 | |
123 | other 2 |
|
119 | other 2 | |
124 |
|
120 | |||
125 | other 3 |
|
121 | other 3 | |
126 |
|
||||
127 | desc--debug: line 1 |
|
122 | desc--debug: line 1 | |
128 | line 2 |
|
123 | line 2 | |
129 |
|
||||
130 | file_adds: |
|
124 | file_adds: | |
131 | file_adds: |
|
125 | file_adds: | |
132 | file_adds: |
|
126 | file_adds: | |
@@ -175,18 +169,18 b' manifest--debug: 3:cb5a1327723b' | |||||
175 | manifest--debug: 2:6e0e82995c35 |
|
169 | manifest--debug: 2:6e0e82995c35 | |
176 | manifest--debug: 1:4e8d705b1e53 |
|
170 | manifest--debug: 1:4e8d705b1e53 | |
177 | manifest--debug: 0:a0c8bcbbb45c |
|
171 | manifest--debug: 0:a0c8bcbbb45c | |
178 | node: 8c7f028fbabf93fde80ef788885370b36abeff33 |
|
172 | node: 10e46f2dcbf4823578cf180f33ecf0b957964c47 | |
179 | node: 259081bc29d176c6ae17af5dd01a3440b3288c97 |
|
173 | node: 97054abb4ab824450e9164180baf491ae0078465 | |
180 | node: 1c37ba7745099d0f206b3a663abcfe127b037433 |
|
174 | node: b608e9d1a3f0273ccf70fb85fd6866b3482bf965 | |
181 | node: 6eb5362d59ec784e4431d3e140c8cc6e1b77ce82 |
|
175 | node: 1e4e1b8f71e05681d422154f5421e385fec3454f | |
182 | node--verbose: 8c7f028fbabf93fde80ef788885370b36abeff33 |
|
176 | node--verbose: 10e46f2dcbf4823578cf180f33ecf0b957964c47 | |
183 | node--verbose: 259081bc29d176c6ae17af5dd01a3440b3288c97 |
|
177 | node--verbose: 97054abb4ab824450e9164180baf491ae0078465 | |
184 | node--verbose: 1c37ba7745099d0f206b3a663abcfe127b037433 |
|
178 | node--verbose: b608e9d1a3f0273ccf70fb85fd6866b3482bf965 | |
185 | node--verbose: 6eb5362d59ec784e4431d3e140c8cc6e1b77ce82 |
|
179 | node--verbose: 1e4e1b8f71e05681d422154f5421e385fec3454f | |
186 | node--debug: 8c7f028fbabf93fde80ef788885370b36abeff33 |
|
180 | node--debug: 10e46f2dcbf4823578cf180f33ecf0b957964c47 | |
187 | node--debug: 259081bc29d176c6ae17af5dd01a3440b3288c97 |
|
181 | node--debug: 97054abb4ab824450e9164180baf491ae0078465 | |
188 | node--debug: 1c37ba7745099d0f206b3a663abcfe127b037433 |
|
182 | node--debug: b608e9d1a3f0273ccf70fb85fd6866b3482bf965 | |
189 | node--debug: 6eb5362d59ec784e4431d3e140c8cc6e1b77ce82 |
|
183 | node--debug: 1e4e1b8f71e05681d422154f5421e385fec3454f | |
190 | parents: |
|
184 | parents: | |
191 | parents: |
|
185 | parents: | |
192 | parents: |
|
186 | parents: | |
@@ -195,9 +189,9 b' parents--verbose:' | |||||
195 | parents--verbose: |
|
189 | parents--verbose: | |
196 | parents--verbose: |
|
190 | parents--verbose: | |
197 | parents--verbose: |
|
191 | parents--verbose: | |
198 |
parents--debug: 2: |
|
192 | parents--debug: 2:97054abb4ab8 -1:000000000000 | |
199 |
parents--debug: 1: |
|
193 | parents--debug: 1:b608e9d1a3f0 -1:000000000000 | |
200 |
parents--debug: 0: |
|
194 | parents--debug: 0:1e4e1b8f71e0 -1:000000000000 | |
201 | parents--debug: -1:000000000000 -1:000000000000 |
|
195 | parents--debug: -1:000000000000 -1:000000000000 | |
202 | rev: 3 |
|
196 | rev: 3 | |
203 | rev: 2 |
|
197 | rev: 2 | |
@@ -252,10 +246,10 b' no user, no domain' | |||||
252 | no person |
|
246 | no person | |
253 | other 1 |
|
247 | other 1 | |
254 | line 1 |
|
248 | line 1 | |
255 | 8c7f028fbabf |
|
249 | 10e46f2dcbf4 | |
256 | 259081bc29d1 |
|
250 | 97054abb4ab8 | |
257 | 1c37ba774509 |
|
251 | b608e9d1a3f0 | |
258 | 6eb5362d59ec |
|
252 | 1e4e1b8f71e0 | |
259 | # error on syntax |
|
253 | # error on syntax | |
260 | abort: t:3: unmatched quotes |
|
254 | abort: t:3: unmatched quotes | |
261 | # done |
|
255 | # done |
@@ -62,7 +62,7 b' echo %% --time' | |||||
62 | hg --cwd a --time tip 2>&1 | grep '^Time:' | sed 's/[0-9][0-9]*/x/g' |
|
62 | hg --cwd a --time tip 2>&1 | grep '^Time:' | sed 's/[0-9][0-9]*/x/g' | |
63 |
|
63 | |||
64 | echo %% --version |
|
64 | echo %% --version | |
65 | hg --version -q | sed 's/version [a-f0-9+]*/version xxx/' |
|
65 | hg --version -q | sed 's/version \([a-f0-9+]*\|unknown\)/version xxx/' | |
66 |
|
66 | |||
67 | echo %% -h/--help |
|
67 | echo %% -h/--help | |
68 | hg -h |
|
68 | hg -h |
@@ -3,6 +3,7 b'' | |||||
3 | hg init a |
|
3 | hg init a | |
4 | cd a |
|
4 | cd a | |
5 | echo a > foo |
|
5 | echo a > foo | |
|
6 | hg rm foo | |||
6 | hg add foo |
|
7 | hg add foo | |
7 | hg commit -m 1 -d "1000000 0" |
|
8 | hg commit -m 1 -d "1000000 0" | |
8 | hg remove |
|
9 | hg remove | |
@@ -17,5 +18,15 b' hg export 1' | |||||
17 | hg log -p -r 0 |
|
18 | hg log -p -r 0 | |
18 | hg log -p -r 1 |
|
19 | hg log -p -r 1 | |
19 |
|
20 | |||
|
21 | echo a > a | |||
|
22 | hg add a | |||
|
23 | hg rm a | |||
|
24 | hg rm -f a | |||
|
25 | echo b > b | |||
|
26 | hg ci -A -m 3 -d "1000001 0" | |||
|
27 | echo c >> b | |||
|
28 | hg rm b | |||
|
29 | hg rm -f b | |||
|
30 | ||||
20 | cd .. |
|
31 | cd .. | |
21 | hg clone a b |
|
32 | hg clone a b |
@@ -1,8 +1,10 b'' | |||||
|
1 | not removing foo: file is not managed | |||
1 | abort: no files specified |
|
2 | abort: no files specified | |
2 | undeleting foo |
|
3 | undeleting foo | |
3 | removing foo |
|
4 | removing foo | |
4 | # HG changeset patch |
|
5 | # HG changeset patch | |
5 | # User test |
|
6 | # User test | |
|
7 | # Date 1000000 0 | |||
6 | # Node ID 8ba83d44753d6259db5ce6524974dd1174e90f47 |
|
8 | # Node ID 8ba83d44753d6259db5ce6524974dd1174e90f47 | |
7 | # Parent 0000000000000000000000000000000000000000 |
|
9 | # Parent 0000000000000000000000000000000000000000 | |
8 | 1 |
|
10 | 1 | |
@@ -14,6 +16,7 b' diff -r 000000000000 -r 8ba83d44753d foo' | |||||
14 | +a |
|
16 | +a | |
15 | # HG changeset patch |
|
17 | # HG changeset patch | |
16 | # User test |
|
18 | # User test | |
|
19 | # Date 1000000 0 | |||
17 | # Node ID a1fce69c50d97881c5c014ab23f580f720c78678 |
|
20 | # Node ID a1fce69c50d97881c5c014ab23f580f720c78678 | |
18 | # Parent 8ba83d44753d6259db5ce6524974dd1174e90f47 |
|
21 | # Parent 8ba83d44753d6259db5ce6524974dd1174e90f47 | |
19 | 2 |
|
22 | 2 | |
@@ -48,4 +51,8 b' diff -r 8ba83d44753d -r a1fce69c50d9 foo' | |||||
48 | -a |
|
51 | -a | |
49 |
|
52 | |||
50 |
|
53 | |||
51 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
54 | not removing a: file has been marked for add (use -f to force removal) | |
|
55 | adding a | |||
|
56 | adding b | |||
|
57 | not removing b: file is modified (use -f to force removal) | |||
|
58 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
@@ -32,12 +32,31 b' hg id' | |||||
32 | hg status |
|
32 | hg status | |
33 |
|
33 | |||
34 | hg commit -m "merge" -d "1000000 0" |
|
34 | hg commit -m "merge" -d "1000000 0" | |
|
35 | ||||
|
36 | # create fake head, make sure tag not visible afterwards | |||
|
37 | cp .hgtags tags | |||
|
38 | hg tag -d "1000000 0" last | |||
|
39 | hg rm .hgtags | |||
|
40 | hg commit -m "remove" -d "1000000 0" | |||
|
41 | ||||
|
42 | mv tags .hgtags | |||
|
43 | hg add .hgtags | |||
|
44 | hg commit -m "readd" -d "1000000 0" | |||
|
45 | ||||
|
46 | hg tags | |||
|
47 | ||||
35 | # invalid tags |
|
48 | # invalid tags | |
36 | echo "spam" >> .hgtags |
|
49 | echo "spam" >> .hgtags | |
37 | echo >> .hgtags |
|
50 | echo >> .hgtags | |
38 | echo "foo bar" >> .hgtags |
|
51 | echo "foo bar" >> .hgtags | |
39 | echo "$T invalid" | sed "s/..../a5a5/" >> .hg/localtags |
|
52 | echo "$T invalid" | sed "s/..../a5a5/" >> .hg/localtags | |
40 | hg commit -m "tags" -d "1000000 0" |
|
53 | hg commit -m "tags" -d "1000000 0" | |
|
54 | ||||
|
55 | # report tag parse error on other head | |||
|
56 | hg up 3 | |||
|
57 | echo 'x y' >> .hgtags | |||
|
58 | hg commit -m "head" -d "1000000 0" | |||
|
59 | ||||
41 | hg tags |
|
60 | hg tags | |
42 | hg tip |
|
61 | hg tip | |
43 |
|
62 |
@@ -16,17 +16,26 b' 1 files updated, 0 files merged, 0 files' | |||||
16 | (branch merge, don't forget to commit) |
|
16 | (branch merge, don't forget to commit) | |
17 | 8216907a933d+8a3ca90d111d+ tip |
|
17 | 8216907a933d+8a3ca90d111d+ tip | |
18 | M .hgtags |
|
18 | M .hgtags | |
19 | .hgtags:2: ignoring invalid tag |
|
19 | tip 6:c6af9d771a81bb9c7f267ec03491224a9f8ba1cd | |
20 | .hgtags:4: ignoring invalid tag |
|
|||
21 | localtags:1: ignoring invalid tag |
|
|||
22 | tip 4:fd868a874787a7b5af31e1675666ce691c803035 |
|
|||
23 | first 0:0acdaf8983679e0aac16e811534eb49d7ee1f2b4 |
|
20 | first 0:0acdaf8983679e0aac16e811534eb49d7ee1f2b4 | |
24 | changeset: 4:fd868a874787 |
|
21 | .hgtags (rev 7:39bba1bbbc4c), line 2: cannot parse entry | |
25 | .hgtags:2: ignoring invalid tag |
|
22 | .hgtags (rev 7:39bba1bbbc4c), line 4: node 'foo' is not well formed | |
26 | .hgtags:4: ignoring invalid tag |
|
23 | localtags, line 1: tag 'invalid' refers to unknown node | |
27 | localtags:1: ignoring invalid tag |
|
24 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
25 | .hgtags (rev 7:39bba1bbbc4c), line 2: cannot parse entry | |||
|
26 | .hgtags (rev 7:39bba1bbbc4c), line 4: node 'foo' is not well formed | |||
|
27 | .hgtags (rev 8:4ca6f1b1a68c), line 2: node 'x' is not well formed | |||
|
28 | localtags, line 1: tag 'invalid' refers to unknown node | |||
|
29 | tip 8:4ca6f1b1a68c77be687a03aaeb1614671ba59b20 | |||
|
30 | first 0:0acdaf8983679e0aac16e811534eb49d7ee1f2b4 | |||
|
31 | changeset: 8:4ca6f1b1a68c | |||
|
32 | .hgtags (rev 7:39bba1bbbc4c), line 2: cannot parse entry | |||
|
33 | .hgtags (rev 7:39bba1bbbc4c), line 4: node 'foo' is not well formed | |||
|
34 | .hgtags (rev 8:4ca6f1b1a68c), line 2: node 'x' is not well formed | |||
|
35 | localtags, line 1: tag 'invalid' refers to unknown node | |||
28 | tag: tip |
|
36 | tag: tip | |
|
37 | parent: 3:b2ef3841386b | |||
29 | user: test |
|
38 | user: test | |
30 | date: Mon Jan 12 13:46:40 1970 +0000 |
|
39 | date: Mon Jan 12 13:46:40 1970 +0000 | |
31 |
summary: |
|
40 | summary: head | |
32 |
|
41 |
General Comments 0
You need to be logged in to leave comments.
Login now