merge with stable
authorThomas Arendsen Hein <thomas@intevation.de>
Wed, 24 Jan 2007 23:07:09 +0100
changeset 4045 1bd6868b0b11
parent 4041 add43809810d (current diff)
parent 4044 78a0dd93db0b (diff)
child 4046 7fd68d2667fe
merge with stable
mercurial/commands.py
mercurial/ui.py
--- a/mercurial/commands.py	Wed Jan 24 23:06:45 2007 +0100
+++ b/mercurial/commands.py	Wed Jan 24 23:07:09 2007 +0100
@@ -2372,8 +2372,7 @@
     files, matchfn, anypats = cmdutil.matchpats(repo, pats, opts)
     cwd = (pats and repo.getcwd()) or ''
     modified, added, removed, deleted, unknown, ignored, clean = [
-        [util.pathto(cwd, x) for x in n]
-        for n in repo.status(node1=node1, node2=node2, files=files,
+        n for n in repo.status(node1=node1, node2=node2, files=files,
                              match=matchfn,
                              list_ignored=all or opts['ignored'],
                              list_clean=all or opts['clean'])]
@@ -2398,11 +2397,11 @@
             format = "%s %%s%s" % (char, end)
 
         for f in changes:
-            ui.write(format % f)
+            ui.write(format % util.pathto(cwd, f))
             if ((all or opts.get('copies')) and not opts.get('no_status')):
                 copied = repo.dirstate.copied(f)
                 if copied:
-                    ui.write('  %s%s' % (copied, end))
+                    ui.write('  %s%s' % (util.pathto(cwd, copied), end))
 
 def tag(ui, repo, name, rev_=None, **opts):
     """add a tag for the current or given revision
--- a/mercurial/ui.py	Wed Jan 24 23:06:45 2007 +0100
+++ b/mercurial/ui.py	Wed Jan 24 23:07:09 2007 +0100
@@ -344,12 +344,14 @@
             user = self.config("ui", "username")
         if user is None:
             user = os.environ.get("EMAIL")
-        if not user:
+        if user is None:
             try:
                 user = '%s@%s' % (util.getuser(), socket.getfqdn())
+                self.warn(_("No username found, using '%s' instead\n") % user)
             except KeyError:
-                raise util.Abort(_("Please specify a username."))
-            self.warn(_("No username found, using '%s' instead\n") % user)
+                pass
+        if not user:
+            raise util.Abort(_("Please specify a username."))
         return user
 
     def shortuser(self, user):
--- a/tests/test-bundle	Wed Jan 24 23:06:45 2007 +0100
+++ b/tests/test-bundle	Wed Jan 24 23:07:09 2007 +0100
@@ -59,3 +59,22 @@
 hg -R bundle://../full.hg outgoing ../partial2
 hg -R bundle://../does-not-exist.hg outgoing ../partial2
 cd ..
+
+# test for 540d1059c802
+hg init orig
+cd orig
+echo foo > foo
+hg add foo
+hg ci -m 'add foo' -d '0 0'
+
+hg clone . ../copy
+hg tag -d '0 0' foo
+
+cd ../copy
+echo >> foo
+hg ci -m 'change foo' -d '0 0'
+hg bundle ../bundle.hg ../orig
+
+cd ../orig
+hg incoming ../bundle.hg
+cd ..
--- a/tests/test-bundle.out	Wed Jan 24 23:06:45 2007 +0100
+++ b/tests/test-bundle.out	Wed Jan 24 23:07:09 2007 +0100
@@ -209,3 +209,13 @@
 summary:     0.3m
 
 abort: No such file or directory: ../does-not-exist.hg
+1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+searching for changes
+searching for changes
+changeset:   2:ed1b79f46b9a
+tag:         tip
+parent:      0:bbd179dfa0a7
+user:        test
+date:        Thu Jan 01 00:00:00 1970 +0000
+summary:     change foo
+
--- a/tests/test-committer	Wed Jan 24 23:06:45 2007 +0100
+++ b/tests/test-committer	Wed Jan 24 23:07:09 2007 +0100
@@ -24,5 +24,8 @@
 hg commit -d '1000000 0' -u "foo@bar.com" -m commit-1
 hg tip
 echo 123 > asdf
+echo "[ui]" > .hg/hgrc
+echo "username = " >> .hg/hgrc
+hg commit -d '1000000 0' -m commit-1
 rm .hg/hgrc
 hg commit -d '1000000 0' -m commit-1 2>&1 | sed -e "s/'[^']*'/user@host/"
--- a/tests/test-committer.out	Wed Jan 24 23:06:45 2007 +0100
+++ b/tests/test-committer.out	Wed Jan 24 23:07:09 2007 +0100
@@ -22,4 +22,7 @@
 date:        Mon Jan 12 13:46:40 1970 +0000
 summary:     commit-1
 
+abort: Please specify a username.
+transaction abort!
+rollback completed
 No username found, using user@host instead