Pull from TAH
authormpm@selenic.com
Sun, 26 Jun 2005 15:12:51 -0800
changeset 484 934279f3ca5358b525cf860069702c362e91d3de
parent 474 b2ae8283d1a6689e8abd4ea75021747897e90bfb (current diff)
parent 483 27f5569a5814a4c182a742df7c50902dea51f490 (diff)
child 485 c5705ab9cebdd3f3e3f0fbf9af8e7ad6b60b330f
push id1
push usergszorc@mozilla.com
push dateWed, 18 Mar 2015 16:34:57 +0000
Pull from TAH -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Pull from TAH manifest hash: 470ea90dd95189a019f4d96016a45db8a297b841 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) iD8DBQFCvzZzywK+sNU5EO8RAkZhAKCUJKX1vFtkFxV7qFwbuWQj62zcnQCfU687 jxKpBVesIXSOpBO4NbW/RIM= =hSBe -----END PGP SIGNATURE-----
TODO
doc/hg.1.txt
hgeditor
mercurial/bdiff.c
mercurial/commands.py
mercurial/hg.py
mercurial/revlog.py
--- a/TODO
+++ b/TODO
@@ -8,21 +8,18 @@ General:
 - export to git
 - Add standard files: AUTHORS, CREDITS, ChangeLog? What else?
 - Code cleanup: apply http://python.org/peps/pep-0008.html
 
 Core:
 - difflib creating/removing files (fixed except dates: should be epoch)
 - directory foo.d or foo.i with existing file foo (use some quoting?)
 - get various options from hgrc (e.g. history always -v, tip always -q)
-- allow full decimal (part of) hash
-  hg export 5005048662 -> OverflowError: long int too large to convert
-  to int
 - better push support (hack exists)
-- hg over ssh://
+- hg over ssh:// and https://
 - commit mailinglist/trigger/hooks
 
 Commands:
 - hg status <filename>: file rev, changeset rev, changed, added,
   deleted, sha-1
 - select to pull a subset of the heads
 - commands.py: number of args too much magic (e.g. in patch())
 - automatic pull fallback to old-http://
@@ -40,8 +37,9 @@ Web:
 - hgweb tip link too verbose
 - hgweb: deliver static files (e.g. favicon, stylesheets)
 - hgweb personalization: timezone (display/change), display of
   features
 - hg export 240 shows -tkmerge (good), hgweb does not (bad).
 - some web servers think hgweb.cgi.[di] is a CGI script with old-http://
   (use quoting (see foo.d in Core) or document server configurations?)
 - link children in hgweb
+- search field searching in descriptions, file names, what else?
--- a/doc/hg.1.txt
+++ b/doc/hg.1.txt
@@ -1,12 +1,12 @@
 HG(1)
 =====
 Matt Mackall <mpm@selenic.com>
-v0.6, 27 May 2005
+v0.6, 24 Jun 2005
 
 NAME
 ----
 hg - Mercurial source code management system
 
 SYNOPSIS
 --------
 'hg' [-v -d -q -y] <command> [command options] [files]
@@ -34,74 +34,74 @@ COMMAND ELEMENTS
 ----------------
 
 files ...::
     indicates one or more filename or relative path filenames
 
 path::
     indicates a path on the local machine
 
-revision:: 
+revision::
     indicates a changeset which can be specified as a changeset revision
     number, a tag, or a unique substring of the changeset hash value
 
 repository path::
     is either the pathname of a local repository of the URI of a remote
     repository.  There are two available URI protocols, http:// which is
-    fast and the old-http:// protocol which is much slower but does not 
+    fast and the old-http:// protocol which is much slower but does not
     require a special server on the web host.
 
 COMMANDS
 --------
 
 add [files ...]::
     Add the given files to the repository.  Note that this just schedules the
     files for addition at the next hg commit time.
 
 addremove::
     Add all new files and remove all missing files from the repository.  New
     files are ignored if they match any of the patterns in .hgignore
 
 annotate [-r <rev> -u -n -c] [files ...]::
-    List the files with each line showing the revision id responsible 
-    for that line. 
+    List the files with each line showing the revision id responsible
+    for that line.
 
     options:
     -r, --revision <rev>  annotate the specified revision
     -u, --user            list the author
     -c, --changeset       list the changeset
     -n, --number          list the revision number (default)
 
 cat <file> [revision]::
     Output the given revision or tip of the specified file to stdout.
 
 commit [-A -t -l <file> -t <text> -u <user> -d <datecode>] [files...]::
-    commit all changed files in the working dir to the repository.  This uses
+    Commit all changed files in the working dir to the repository.  This uses
     the EDITOR environment variable to bring up an editor to add a commit
     comment.
 
     Options:
-    
+
     -A, --addremove       run addremove during commit
     -t, --text <text>     use <text> as commit message
     -l, --logfile <file>  read the commit message from the specified
                           file
     -d, --date <datecode> use the specified date code
     -u, --user <user>     record commit as the specified user
 
     aliases: ci
 
 copy <source> <dest>::
     Mark a file as copied or renamed for the next commit.
 
 diff [-r revision] [-r revision] [files ...]::
-    Generate a unified diff of the indicated files. If there are no 
-    revisions specified, the working directory file is compared to 
-    the tip, one revision specified indicates a comparison between the 
-    working directory file and the specified revision, and two revisions 
+    Generate a unified diff of the indicated files. If there are no
+    revisions specified, the working directory file is compared to
+    the tip, one revision specified indicates a comparison between the
+    working directory file and the specified revision, and two revisions
     compares the two versions specified.
 
 export [revision]::
     Print the changeset header (author, changeset hash, parent, and commit
     comment) and the diffs for a particular revision.
 
 forget [files]::
     Undo an 'hg add' scheduled for the next commit.
@@ -113,17 +113,17 @@ heads::
 history::
     Print the revision history of the repository. Use the -v switch
     for more detail.
 
 identify::
     Print a short identifier of the current state of the repo. This
     includes one or two parent hash identifiers, followed by
     a "+" if there are uncommitted changes in the working directory,
-    followed by a list of tags for this revision
+    followed by a list of tags for this revision.
 
     aliases: id
 
 import [-p <n> -b <base> -q] <patches>::
     Import the listed patches and commit them individually.
 
     options:
     -p, --strip <n>   directory strip option for patch
@@ -145,23 +145,23 @@ init [-u] [source]::
     options:
     -u, --update   update the working directory to match the tip
 
 log <file>::
     Print the revision history of the specified file.
 
 manifest [revision]::
     Print the indicated revision of the manifest (list of version controlled
-    files)
+    files).
 
 parents::
     Print the working directory's parent revisions.
 
 pull <repository path>::
-    pull any changes from the specified repository to the repository in the
+    Pull any changes from the specified repository to the repository in the
     current directory.
 
     options:
     -u, --update   update the working directory to tip after pull
 
 push <destination>::
     Push changes from the local repository to the specified
     destination. If the destination is local, this is identical to a
@@ -170,28 +170,31 @@ push <destination>::
     The other currently available push method is SSH. This requires an
     accessible shell account on the destination machine and a copy of
     hg in the remote path. Destinations are specified in the following
     form:
 
       ssh://[user@]host[:port]/path
 
 rawcommit [-p -d -u -F -t -l]::
-    Primarily useful for importing from other SCMs. 
+    Primarily useful for importing from other SCMs.
 
 recover::
     Recover from an interrupted commit or pull. This should only be
     necessary when Mercurial suggests it.
 
 remove [files ...]::
-    schedule the indicated files for removal from the repository at the next
-    commit
- 
+    Schedule the indicated files for removal from the repository at the next
+    commit.
+
     aliases: rm
 
+root::
+    Print the root directory of the current repository.
+
 serve [-a addr -n name -p port -t templatedir]::
     Start a local HTTP repository browser and pull server.
 
     options:
     -a, --address <addr> address to use
     -p, --port <n>       port to use (default: 8000)
     -n, --name <name>    name to show in web pages (default: working dir)
     -t, --templatedir <path> web templates to use
@@ -208,20 +211,20 @@ tag [-t <text> -d <datecode> -u <user>] 
     Add a tag <name> to the specified revision or the tip.
 
     options:
     -t, --text <text>     message for tag commit log entry
     -d, --date <datecode> datecode for commit
     -u, --user <user>     user for commit
 
 tags::
-    List the current tags.
+    List the repository tags.
 
 tip::
-    Show the tip revision
+    Show the tip revision.
 
 undo::
     Undo the last commit or pull transaction.
 
 update [-m -C] [revision]::
     Update or merge the working directory to a specified revision.
 
     If there are no outstanding changes in the working directory and
@@ -251,46 +254,51 @@ verify::
     integrity, validating the hashes and checksums of each entry in
     the changelog, manifest, and tracked files, as well as the
     integrity of their crosslinks and indices.
 
 
 ENVIRONMENT VARIABLES
 ---------------------
 
+HGEDITOR::
+    This is the name of the editor to use when committing. Defaults to the
+    value of EDITOR.
+
 HGMERGE::
     An executable to use for resolving merge conflicts. The program ,
     will be executed with three arguments: local file, remote file,
     ancestor file.
 
     The default program is "hgmerge", which is a shell script provided
     by Mercurial with some sensible defaults.
 
 HGUSER::
     This is the string used for the author of a commit.
 
 EMAIL::
     If HGUSER is not set, this will be used as the author for a commit.
 
 LOGNAME::
-    if neither HGUSER nor EMAIL is set, LOGNAME will be used (with
+    If neither HGUSER nor EMAIL is set, LOGNAME will be used (with
     '@hostname' appended) as the author value for a commit.
 
 EDITOR::
-    This is the name of the editor to use when committing. Defaults to 'vi'.
+    This is the name of the editor used in the hgmerge script. It will be
+    used for commit messages, too, if HGEDITOR isn't set. Defaults to 'vi'.
 
 PYTHONPATH::
     This is used by Python to find imported modules and may need to be set
     appropriately if Mercurial is not installed system-wide.
 
 FILES
 -----
  .hgignore::
     This file contains regular expressions (one per line) that describe file
-    names that should be ignored by hg
+    names that should be ignored by hg.
 
  .hgtags::
     This file contains changeset hash values and text tag names (one of each
     seperated by spaces) that correspond to tagged versions of the repository
     contents.
 
  $HOME/.hgrc, .hg/hgrc::
     This file contains defaults and configuration. Values in .hg/hgrc
@@ -301,16 +309,17 @@ NAMED REPOSITORIES
 
     To give symbolic names to a repository, create a section in .hgrc
     or .hg/hgrc containing assignments of names to paths.
 
     Example:
 
 [paths]
 hg = http://selenic.com/hg
+tah = http://hg.intevation.org/mercurial-tah/
 
 NON_TRANSPARENT PROXY SUPPORT
 -----------------------------
 
     To access a Mercurial repository through a proxy,
     create a file $HOME/.hgrc in the following format:
 
 [http_proxy]
--- a/hgeditor
+++ b/hgeditor
@@ -22,17 +22,22 @@ if grep -q "^HG: merge resolve" "$1" ; t
     # we don't sign merges
     exec $EDITOR "$1"
 else
     T1=`mktemp`; T2=`mktemp`
     MANIFEST=`grep '^HG: manifest hash' "$1" | cut -b 19-`
 
     echo -e "\n\nmanifest hash: $MANIFEST" >> "$T1"
     grep -vE '^(HG: manifest hash .*)?$' "$1" >> "$T1"
-    hg diff >> "$T2"
+    (
+        cd "`hg root`"
+        grep '^HG: changed' "$1" | cut -b 13- | while read changed; do
+            hg diff "$changed" >> "$T2"
+        done
+    )
 
     CHECKSUM=`md5sum "$T1"`
     $EDITOR "$T1" "$T2" || cleanup_exit $?
     echo "$CHECKSUM" | md5sum -c 2>/dev/null && cleanup_exit 0
     {
         head -1 "$T1"
         echo
         grep -v "^HG:" "$T1" | gpg -a -u "${HGUSER:-$EMAIL}" --clearsign
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -167,23 +167,20 @@ def help(ui, cmd=None):
         sys.exit(0)
     else:
         if not ui.quiet:
             show_version(ui)
             ui.write('\n')
         ui.write('hg commands:\n\n')
 
         h = {}
-        for c,e in table.items():
-            f = c
-            aliases = None
-            if "|" in f:
-                l = f.split("|")
-                f, aliases = l[0], l[1:]
-            if f.startswith("debug"): continue
+        for c, e in table.items():
+            f = c.split("|")[0]
+            if f.startswith("debug"):
+                continue
             d = ""
             if e[0].__doc__:
                 d = e[0].__doc__.splitlines(0)[0].rstrip()
             h[f] = d
 
         fns = h.keys()
         fns.sort()
         m = max(map(len, fns))
@@ -237,18 +234,16 @@ def annotate(u, repo, file, *files, **op
     if not ops['user'] and not ops['changeset']:
         ops['number'] = 1
 
     node = repo.dirstate.parents()[0]
     if ops['revision']:
         node = repo.changelog.lookup(ops['revision'])
     change = repo.changelog.read(node)
     mmap = repo.manifest.read(change[0])
-    maxuserlen = 0
-    maxchangelen = 0
     for f in relpath(repo, (file,) + files):
         lines = repo.file(f).annotate(mmap[f])
         pieces = []
 
         for o, f in opmap:
             if ops[o]:
                 l = [ f(n) for n,t in lines ]
                 m = max(map(len, l))
@@ -338,17 +333,17 @@ def debugindexdot(ui, file):
 
 def diff(ui, repo, *files, **opts):
     """diff working directory (or selected files)"""
     revs = []
     if opts['rev']:
         revs = map(lambda x: repo.lookup(x), opts['rev'])
 
     if len(revs) > 2:
-        self.ui.warn("too many revisions to diff\n")
+        ui.warn("too many revisions to diff\n")
         sys.exit(1)
 
     if files:
         files = relpath(repo, files)
     else:
         files = relpath(repo, [""])
 
     dodiff(ui, repo, os.getcwd(), files, *revs)
@@ -429,18 +424,17 @@ def import_(ui, repo, patch1, *patches, 
 
         # make sure text isn't empty
         if not text: text = "imported patch %s\n" % patch
 
         f = os.popen("patch -p%d < %s" % (strip, pf))
         files = []
         for l in f.read().splitlines():
             l.rstrip('\r\n');
-            if not quiet:
-                print l
+            ui.status("%s\n" % l)
             if l[:14] == 'patching file ':
                 pf = l[14:]
                 if pf not in files:
                     files.append(pf)
         patcherr = f.close()
         if patcherr:
             sys.stderr.write("patch failed")
             sys.exit(1)
@@ -657,25 +651,25 @@ def tag(ui, repo, name, rev = None, **op
 
     if not opts['text']:
         opts['text'] = "Added tag %s for changeset %s" % (name, r)
 
     repo.commit([".hgtags"], opts['text'], opts['user'], opts['date'])
 
 def tags(ui, repo):
     """list repository tags"""
-    
+
     l = repo.tagslist()
     l.reverse()
-    for t,n in l:
+    for t, n in l:
         try:
-            r = repo.changelog.rev(n)
+            r = "%5d:%s" % (repo.changelog.rev(n), hg.hex(n))
         except KeyError:
-            r = "?"
-        print "%-30s %5d:%s" % (t, repo.changelog.rev(n), hg.hex(n))
+            r = "    ?:?"
+        ui.write("%-30s %s\n" % (t, r))
 
 def tip(ui, repo):
     """show the tip revision"""
     n = repo.changelog.tip()
     show_changeset(ui, repo, changenode=n)
 
 def undo(ui, repo):
     """undo the last transaction"""
@@ -777,17 +771,16 @@ table = {
              'hg update [options] [node]'),
     "verify": (verify, [], 'hg verify'),
     "version": (show_version, [], 'hg version'),
     }
 
 norepo = "init version help debugindex debugindexdot"
 
 def find(cmd):
-    i = None
     for e in table.keys():
         if re.match("(%s)$" % e, cmd):
             return table[e]
 
     raise UnknownCommand(cmd)
 
 class SignalInterrupt(Exception): pass
 
--- a/mercurial/hg.py
+++ b/mercurial/hg.py
@@ -368,42 +368,51 @@ class localrepository:
                         self.ignorelist.append(re.compile(util.pconvert(pat[:-1])))
             except IOError: pass
         for pat in self.ignorelist:
             if pat.search(f): return True
         return False
 
     def tags(self):
         '''return a mapping of tag to node'''
-        if not self.tagscache: 
+        if not self.tagscache:
             self.tagscache = {}
             try:
                 # read each head of the tags file, ending with the tip
                 # and add each tag found to the map, with "newer" ones
                 # taking precedence
                 fl = self.file(".hgtags")
                 h = fl.heads()
                 h.reverse()
                 for r in h:
                     for l in fl.revision(r).splitlines():
                         if l:
                             n, k = l.split(" ", 1)
-                            self.tagscache[k.strip()] = bin(n)
-            except KeyError: pass
+                            try:
+                                bin_n = bin(n)
+                            except TypeError:
+                                bin_n = ''
+                            self.tagscache[k.strip()] = bin_n
+            except KeyError:
+                pass
             for k, n in self.ui.configitems("tags"):
-                self.tagscache[k] = bin(n)
-                
+                try:
+                    bin_n = bin(n)
+                except TypeError:
+                    bin_n = ''
+                self.tagscache[k] = bin_n
+
             self.tagscache['tip'] = self.changelog.tip()
 
         return self.tagscache
 
     def tagslist(self):
         '''return a list of tags ordered by revision'''
         l = []
-        for t,n in self.tags().items():
+        for t, n in self.tags().items():
             try:
                 r = self.changelog.rev(n)
             except:
                 r = -2 # sort to the beginning of the list if unknown
             l.append((r,t,n))
         l.sort()
         return [(t,n) for r,t,n in l]
 
--- a/mercurial/revlog.py
+++ b/mercurial/revlog.py
@@ -190,17 +190,17 @@ class revlog:
                     continue
         return c
     
     def lookup(self, id):
         try:
             rev = int(id)
             if str(rev) != id: raise ValueError
             if rev < 0: rev = self.count() + rev
-            if rev < 0 or rev >= self.count: raise ValueError
+            if rev < 0 or rev >= self.count(): raise ValueError
             return self.node(rev)
         except (ValueError, OverflowError):
             c = []
             for n in self.nodemap:
                 if hex(n).startswith(id):
                     c.append(n)
             if len(c) > 1: raise KeyError("Ambiguous identifier")
             if len(c) < 1: raise KeyError("No match found")