merge with crew-stable
authorThomas Arendsen Hein <thomas@intevation.de>
Sat, 16 Dec 2006 23:36:06 +0100
changeset 3920 b12eae71382d
parent 3909 dd86f99e3c02 (current diff)
parent 3919 5f0e00224cde (diff)
child 3922 693eec9570f3
merge with crew-stable
hgext/gpg.py
mercurial/commands.py
--- a/contrib/convert-repo	Sat Dec 16 14:40:55 2006 +0100
+++ b/contrib/convert-repo	Sat Dec 16 23:36:06 2006 +0100
@@ -6,19 +6,20 @@
 # In its current form, it's hardcoded to convert incrementally between
 # git and Mercurial.
 #
-# To use, you must first import the first git version into Mercurial,
-# and establish a mapping between the git commit hash and the hash in
-# Mercurial for that version. This mapping is kept in a simple text
-# file with lines like so:
+# To use, run:
+#
+# convert-repo <git-dir> <hg-dir> <mapfile>
+#
+# (don't forget to create the <hg-dir> repository beforehand)
+#
+# The <mapfile> is a simple text file that maps a git commit hash to
+# the hash in Mercurial for that version, like so:
 #
 # <git hash> <mercurial hash>
 #
-# To convert the rest of the repo, run:
-#
-# convert-repo <git-dir> <hg-dir> <mapfile>
-#
-# This updates the mapfile on each commit copied, so it can be
-# interrupted and can be run repeatedly to copy new commits.
+# If the file doesn't exist, it's automatically created.  It's updated
+# on each commit copied, so convert-repo can be interrupted and can
+# be run repeatedly to copy new commits.
 
 import sys, os, zlib, sha, time
 
@@ -85,7 +86,7 @@
                 committer = " ".join(p[:-2])
                 if committer[0] == "<": committer = committer[1:-1]
                 committer = recode(committer)
-                message += "\ncommitter: %s\n" % v
+                message += "\ncommitter: %s\n" % committer
             if n == "parent": parents.append(v)
 
         tzs, tzh, tzm = tz[-5:-4] + "1", tz[-4:-2], tz[-2:]
@@ -295,7 +296,8 @@
             nrev = self.dest.puttags(ctags)
             # write another hash correspondence to override the previous
             # one so we don't end up with extra tag heads
-            file(self.mapfile, "a").write("%s %s\n" % (c, nrev))
+            if nrev:
+                file(self.mapfile, "a").write("%s %s\n" % (c, nrev))
 
 gitpath, hgpath, mapfile = sys.argv[1:]
 if os.path.isdir(gitpath + "/.git"):
--- a/hgext/gpg.py	Sat Dec 16 14:40:55 2006 +0100
+++ b/hgext/gpg.py	Sat Dec 16 23:36:06 2006 +0100
@@ -194,14 +194,25 @@
         return user
 
 def sign(ui, repo, *revs, **opts):
-    """add a signature for the current tip or a given revision"""
+    """add a signature for the current or given revision
+
+    If no revision is given, the parent of the working directory is used,
+    or tip if no revision is checked out.
+    """
+
     mygpg = newgpg(ui, **opts)
     sigver = "0"
     sigmessage = ""
     if revs:
         nodes = [repo.lookup(n) for n in revs]
     else:
-        nodes = [repo.changelog.tip()]
+        nodes = [node for node in repo.dirstate.parents()
+                 if node != hgnode.nullid]
+        if len(nodes) > 1:
+            raise util.Abort(_('uncommitted merge - please provide a '
+                               'specific revision'))
+        if not nodes:
+            nodes = [repo.changelog.tip()]
 
     for n in nodes:
         hexnode = hgnode.hex(n)
--- a/mercurial/commands.py	Sat Dec 16 14:40:55 2006 +0100
+++ b/mercurial/commands.py	Sat Dec 16 23:36:06 2006 +0100
@@ -338,11 +338,11 @@
     changegroup.writebundle(cg, fname, "HG10BZ")
 
 def cat(ui, repo, file1, *pats, **opts):
-    """output the latest or given revisions of files
+    """output the current or given revision of files
 
     Print the specified files as they were at the given revision.
-    If no revision is given then working dir parent is used, or tip
-    if no revision is checked out.
+    If no revision is given, the parent of the working directory is used,
+    or tip if no revision is checked out.
 
     Output may be to a file, in which case the name of the file is
     given using a format string.  The formatting rules are the same as
@@ -1739,9 +1739,11 @@
                 count += 1
 
 def manifest(ui, repo, rev=None):
-    """output the latest or given revision of the project manifest
+    """output the current or given revision of the project manifest
 
     Print a list of version controlled files for the given revision.
+    If no revision is given, the parent of the working directory is used,
+    or tip if no revision is checked out.
 
     The manifest is the list of files being version controlled. If no revision
     is given then the first parent of the working directory is used.
@@ -2398,7 +2400,7 @@
                     ui.write('  %s%s' % (copied, end))
 
 def tag(ui, repo, name, rev_=None, **opts):
-    """add a tag for the current tip or a given revision
+    """add a tag for the current or given revision
 
     Name a particular revision using <name>.
 
@@ -2406,7 +2408,8 @@
     very useful to compare different revision, to go back to significant
     earlier versions or to mark branch points as releases, etc.
 
-    If no revision is given, the parent of the working directory is used.
+    If no revision is given, the parent of the working directory is used,
+    or tip if no revision is checked out.
 
     To facilitate version control, distribution, and merging of tags,
     they are stored as a file named ".hgtags" which is managed
--- a/mercurial/help.py	Sat Dec 16 14:40:55 2006 +0100
+++ b/mercurial/help.py	Sat Dec 16 23:36:06 2006 +0100
@@ -24,7 +24,6 @@
     "12-6"
     "12/6"
     "12/6/6" (Dec 6 2006)
-    "" (Jan 1 00:00:00 1970 UTC)
 
     Lastly, there is Mercurial's internal format:
 
--- a/tests/test-globalopts.out	Sat Dec 16 14:40:55 2006 +0100
+++ b/tests/test-globalopts.out	Sat Dec 16 23:36:06 2006 +0100
@@ -125,7 +125,7 @@
  branch       set or show the current branch name
  branches     list repository named branches
  bundle       create a changegroup file
- cat          output the latest or given revisions of files
+ cat          output the current or given revision of files
  clone        make a copy of an existing repository
  commit       commit the specified files or all outstanding changes
  copy         mark files as copied for the next commit
@@ -140,7 +140,7 @@
  init         create a new repository in the given directory
  locate       locate files matching specific patterns
  log          show revision history of entire repository or files
- manifest     output the latest or given revision of the project manifest
+ manifest     output the current or given revision of the project manifest
  merge        Merge working directory with another revision
  outgoing     show changesets not found in destination
  parents      show the parents of the working dir or revision
@@ -156,7 +156,7 @@
  serve        export the repository via HTTP
  showconfig   show combined config settings from all hgrc files
  status       show changed files in the working directory
- tag          add a tag for the current tip or a given revision
+ tag          add a tag for the current or given revision
  tags         list repository tags
  tip          show the tip revision
  unbundle     apply a changegroup file
@@ -175,7 +175,7 @@
  branch       set or show the current branch name
  branches     list repository named branches
  bundle       create a changegroup file
- cat          output the latest or given revisions of files
+ cat          output the current or given revision of files
  clone        make a copy of an existing repository
  commit       commit the specified files or all outstanding changes
  copy         mark files as copied for the next commit
@@ -190,7 +190,7 @@
  init         create a new repository in the given directory
  locate       locate files matching specific patterns
  log          show revision history of entire repository or files
- manifest     output the latest or given revision of the project manifest
+ manifest     output the current or given revision of the project manifest
  merge        Merge working directory with another revision
  outgoing     show changesets not found in destination
  parents      show the parents of the working dir or revision
@@ -206,7 +206,7 @@
  serve        export the repository via HTTP
  showconfig   show combined config settings from all hgrc files
  status       show changed files in the working directory
- tag          add a tag for the current tip or a given revision
+ tag          add a tag for the current or given revision
  tags         list repository tags
  tip          show the tip revision
  unbundle     apply a changegroup file
--- a/tests/test-help.out	Sat Dec 16 14:40:55 2006 +0100
+++ b/tests/test-help.out	Sat Dec 16 23:36:06 2006 +0100
@@ -46,7 +46,7 @@
  branch       set or show the current branch name
  branches     list repository named branches
  bundle       create a changegroup file
- cat          output the latest or given revisions of files
+ cat          output the current or given revision of files
  clone        make a copy of an existing repository
  commit       commit the specified files or all outstanding changes
  copy         mark files as copied for the next commit
@@ -61,7 +61,7 @@
  init         create a new repository in the given directory
  locate       locate files matching specific patterns
  log          show revision history of entire repository or files
- manifest     output the latest or given revision of the project manifest
+ manifest     output the current or given revision of the project manifest
  merge        Merge working directory with another revision
  outgoing     show changesets not found in destination
  parents      show the parents of the working dir or revision
@@ -77,7 +77,7 @@
  serve        export the repository via HTTP
  showconfig   show combined config settings from all hgrc files
  status       show changed files in the working directory
- tag          add a tag for the current tip or a given revision
+ tag          add a tag for the current or given revision
  tags         list repository tags
  tip          show the tip revision
  unbundle     apply a changegroup file
@@ -92,7 +92,7 @@
  branch       set or show the current branch name
  branches     list repository named branches
  bundle       create a changegroup file
- cat          output the latest or given revisions of files
+ cat          output the current or given revision of files
  clone        make a copy of an existing repository
  commit       commit the specified files or all outstanding changes
  copy         mark files as copied for the next commit
@@ -107,7 +107,7 @@
  init         create a new repository in the given directory
  locate       locate files matching specific patterns
  log          show revision history of entire repository or files
- manifest     output the latest or given revision of the project manifest
+ manifest     output the current or given revision of the project manifest
  merge        Merge working directory with another revision
  outgoing     show changesets not found in destination
  parents      show the parents of the working dir or revision
@@ -123,7 +123,7 @@
  serve        export the repository via HTTP
  showconfig   show combined config settings from all hgrc files
  status       show changed files in the working directory
- tag          add a tag for the current tip or a given revision
+ tag          add a tag for the current or given revision
  tags         list repository tags
  tip          show the tip revision
  unbundle     apply a changegroup file
--- a/tests/test-hup	Sat Dec 16 14:40:55 2006 +0100
+++ b/tests/test-hup	Sat Dec 16 23:36:06 2006 +0100
@@ -10,7 +10,4 @@
 sleep 3
 kill -HUP $P
 wait
-ls -R .hg
-
-
-
+echo .hg/* .hg/store/*
--- a/tests/test-hup.out	Sat Dec 16 14:40:55 2006 +0100
+++ b/tests/test-hup.out	Sat Dec 16 23:36:06 2006 +0100
@@ -4,11 +4,4 @@
 killed!
 transaction abort!
 rollback completed
-.hg:
-00changelog.i
-journal.dirstate
-requires
-store
-
-.hg/store:
-00changelog.i
+.hg/00changelog.i .hg/journal.dirstate .hg/requires .hg/store .hg/store/00changelog.i