changeset 11091:3ec4c5442910

Merge with main
author Brendan Cully <brendan@kublai.com>
date Mon, 03 May 2010 15:28:04 -0700
parents 70a0acfe51d6 (current diff) c4347e48b0d0 (diff)
children 2dd91779eb27
files mercurial/commands.py
diffstat 4 files changed, 30 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/keyword.py	Mon May 03 15:27:05 2010 -0700
+++ b/hgext/keyword.py	Mon May 03 15:28:04 2010 -0700
@@ -160,12 +160,9 @@
         Caveat: localrepository._link fails on Windows.'''
         return self.match(path) and not 'l' in flagfunc(path)
 
-    def overwrite(self, node, expand, candidates, recctx=None):
+    def overwrite(self, node, expand, candidates):
         '''Overwrites selected files expanding/shrinking keywords.'''
-        if recctx is None:
-            ctx = self.repo[node]
-        else:
-            ctx = recctx
+        ctx = self.repo[node]
         mf = ctx.manifest()
         if node is not None:     # commit, record
             candidates = [f for f in ctx.files() if f in mf]
@@ -175,7 +172,7 @@
             msg = (expand and _('overwriting %s expanding keywords\n')
                    or _('overwriting %s shrinking keywords\n'))
             for f in candidates:
-                if recctx is None:
+                if not self.record:
                     data = self.repo.file(f).read(mf[f])
                 else:
                     data = self.repo.wread(f)
@@ -507,7 +504,7 @@
             ret = orig(ui, repo, commitfunc, *pats, **opts)
             recctx = repo['.']
             if ctx != recctx:
-                kwt.overwrite('.',  True, None, recctx)
+                kwt.overwrite('.',  True, None)
             return ret
         finally:
             wlock.release()
--- a/mercurial/commands.py	Mon May 03 15:27:05 2010 -0700
+++ b/mercurial/commands.py	Mon May 03 15:28:04 2010 -0700
@@ -3109,15 +3109,21 @@
         ui.status(m, label='log.branch')
 
     st = list(repo.status(unknown=True))[:6]
+
     ms = mergemod.mergestate(repo)
     st.append([f for f in ms if ms[f] == 'u'])
+
+    subs = [s for s in ctx.substate if ctx.sub(s).dirty()]
+    st.append(subs)
+
     labels = [ui.label(_('%d modified'), 'status.modified'),
               ui.label(_('%d added'), 'status.added'),
               ui.label(_('%d removed'), 'status.removed'),
               ui.label(_('%d deleted'), 'status.deleted'),
               ui.label(_('%d unknown'), 'status.unknown'),
               ui.label(_('%d ignored'), 'status.ignored'),
-              ui.label(_('%d unresolved'), 'resolve.unresolved')]
+              ui.label(_('%d unresolved'), 'resolve.unresolved'),
+              ui.label(_('%d subrepos'), 'status.modified')]
     t = []
     for s, l in zip(st, labels):
         if s:
@@ -3130,7 +3136,7 @@
         t += _(' (merge)')
     elif branch != parents[0].branch():
         t += _(' (new branch)')
-    elif (not st[0] and not st[1] and not st[2]):
+    elif (not st[0] and not st[1] and not st[2] and not st[7]):
         t += _(' (clean)')
         cleanworkdir = True
     elif pnode not in bheads:
--- a/tests/test-subrepo	Mon May 03 15:27:05 2010 -0700
+++ b/tests/test-subrepo	Mon May 03 15:28:04 2010 -0700
@@ -16,6 +16,7 @@
 hg init s
 echo a > s/a
 hg -R s ci -Ams0
+hg sum
 hg ci -m1
 
 echo % add sub sub
@@ -24,7 +25,9 @@
 echo a > s/ss/a
 hg -R s add s/.hgsub
 hg -R s/ss add s/ss/a
+hg sum
 hg ci -m2
+hg sum
 
 echo % bump sub rev
 echo b > s/a
--- a/tests/test-subrepo.out	Mon May 03 15:27:05 2010 -0700
+++ b/tests/test-subrepo.out	Mon May 03 15:28:04 2010 -0700
@@ -2,10 +2,25 @@
 adding a
 % add first sub
 adding a
+parent: 0:f7b1eb17ad24 tip
+ 0
+branch: default
+commit: 1 added, 1 subrepos
+update: (current)
 committing subrepository s
 % add sub sub
+parent: 1:7cf8cfea66e4 tip
+ 1
+branch: default
+commit: 1 subrepos
+update: (current)
 committing subrepository s
 committing subrepository ss
+parent: 2:df30734270ae tip
+ 2
+branch: default
+commit: (clean)
+update: (current)
 % bump sub rev
 committing subrepository s
 % leave sub dirty