Changeset ba7f458edcb3…
Parent 1a2472db6728…
by
Changes to one file · Browse files at ba7f458edcb3 Showing diff from parent 1a2472db6728 Diff from another changeset...
@@ -34,11 +34,19 @@
_nonexistant = _('[non-existant]')
+# This global counter is incremented for each visual diff done in a session
+# It ensures that the names for snapshots created do not collide.
+_diffCount = 0
+
def snapshotset(repo, ctxs, sa, sb, copies, copyworkingdir = False):
'''snapshot files from parent-child set of revisions'''
ctx1a, ctx1b, ctx2 = ctxs
mod_a, add_a, rem_a = sa
mod_b, add_b, rem_b = sb
+
+ global _diffCount
+ _diffCount += 1
+
if copies:
sources = set(copies.values())
else:
@@ -82,7 +90,7 @@ '''snapshot files as of some revision'''
dirname = os.path.basename(repo.root) or 'root'
if ctx.rev() is not None:
- dirname = '%s.%s' % (dirname, str(ctx))
+ dirname = '%s.%d.%d' % (dirname, _diffCount, ctx.rev())
base = os.path.join(qtlib.gettempdir(), dirname)
fns_and_mtime = []
if not os.path.exists(base):
|
Loading...