D6663: tests: glob over some timing numbers in test-shelve.t

2019-07-20 Thread mharbison72 (Matt Harbison)
mharbison72 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  The Windows bot is slow enough that it was 2s in the first hunk.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D6663

AFFECTED FILES
  tests/test-shelve.t

CHANGE DETAILS

diff --git a/tests/test-shelve.t b/tests/test-shelve.t
--- a/tests/test-shelve.t
+++ b/tests/test-shelve.t
@@ -1178,7 +1178,7 @@
   $ hg add e
   $ hg ci -m e
   $ hg shelve --patch
-  default (1s ago)changes to: b
+  default (*s ago)changes to: b (glob)
   
   diff --git a/c b/c
   new file mode 100644
@@ -1226,7 +1226,7 @@
   e
 -- shelve should not contain `c` now
   $ hg shelve --patch
-  default (1s ago)changes to: b
+  default (*s ago)changes to: b (glob)
   
   diff --git a/d b/d
   new file mode 100644
@@ -1300,7 +1300,7 @@
   A
   B
   $ hg shelve --patch
-  default (1s ago)changes to: add B to foo
+  default (*s ago)changes to: add B to foo (glob)
   
   diff --git a/foo b/foo
   --- a/foo



To: mharbison72, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D6662: py3: add a b'' prefix in tests/test-convert-identity.t

2019-07-20 Thread martinvonz (Martin von Zweigbergk)
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D6662

AFFECTED FILES
  tests/test-convert-identity.t

CHANGE DETAILS

diff --git a/tests/test-convert-identity.t b/tests/test-convert-identity.t
--- a/tests/test-convert-identity.t
+++ b/tests/test-convert-identity.t
@@ -10,7 +10,7 @@
   $ cat <<'EOF' > changefileslist.py
   > from mercurial import (changelog, extensions)
   > def wrap(orig, clog, manifest, files, *args, **kwargs):
-  >   return orig(clog, manifest, ["a"], *args, **kwargs)
+  >   return orig(clog, manifest, [b"a"], *args, **kwargs)
   > def extsetup(ui):
   >   extensions.wrapfunction(changelog.changelog, 'add', wrap)
   > EOF



To: martinvonz, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D6655: continue: added support for graft

2019-07-20 Thread taapas1128 (Taapas Agrawal)
taapas1128 added inline comments.

INLINE COMMENTS

> mharbison72 wrote in test-graft.t:1
> This has the same problem D6579  had 
> where there are 4 separate test cases, instead of 2 with sub cases.

@mharbison72 I have generated a patch for that in D6659 
. I minimized it to 3 cases as @durin42 
stated about bloating of the test sets.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6655/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D6655

To: taapas1128, #hg-reviewers
Cc: yuja, mharbison72, martinvonz, durin42, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D6659: graft: split graft code to avoid duplication

2019-07-20 Thread taapas1128 (Taapas Agrawal)
taapas1128 updated this revision to Diff 15978.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6659?vs=15973=15978

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6659/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D6659

AFFECTED FILES
  mercurial/cmdutil.py
  mercurial/commands.py
  tests/test-graft.t
  tests/test-issue1175.t

CHANGE DETAILS

diff --git a/tests/test-issue1175.t b/tests/test-issue1175.t
--- a/tests/test-issue1175.t
+++ b/tests/test-issue1175.t
@@ -1,3 +1,11 @@
+#testcases continueflag continuecommand
+#if continueflag
+  $ cat >> $HGRCPATH < [alias]
+  > continue = graft --continue
+  > EOF
+#endif
+
 https://bz.mercurial-scm.org/1175
 
   $ hg init
@@ -80,7 +88,7 @@
   $ hg resolve --mark b
   (no more unresolved files)
   continue: hg graft --continue
-  $ hg graft --continue
+  $ hg continue
   grafting 1:5974126fad84 "b1"
   warning: can't find ancestor for 'b' copied from 'a'!
   $ hg log -f b -T 'changeset:   {rev}:{node|short}\nsummary: {desc}\n\n'
diff --git a/tests/test-graft.t b/tests/test-graft.t
--- a/tests/test-graft.t
+++ b/tests/test-graft.t
@@ -1,4 +1,4 @@
-#testcases abortcommand abortflag continueflag continuecommand
+#testcases commandmode abortflag continueflag
 
   $ cat >> $HGRCPATH < [extdiff]
@@ -1707,7 +1707,7 @@
   (no more unresolved files)
   continue: hg graft --continue
 
-#if continuecommand
+#if commandmode
   $ hg continue --dry-run
   graft in progress, will be resumed
 #endif
@@ -2041,7 +2041,7 @@
   abort: cannot specify any other flag with '--abort'
   [255]
 
-#if abortcommand
+#if commandmode
 when in dry-run mode
   $ hg abort --dry-run
   graft in progress, will be aborted
diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -2474,9 +2474,6 @@
 if not opts.get('date') and opts.get('currentdate'):
 opts['date'] = "%d %d" % dateutil.makedate()
 
-editor = cmdutil.getcommiteditor(editform='graft',
- **pycompat.strkwargs(opts))
-
 cont = False
 if opts.get('no_commit'):
 if opts.get('edit'):
@@ -2522,17 +2519,7 @@
 raise error.Abort(_("can't specify --continue and revisions"))
 # read in unfinished revisions
 if graftstate.exists():
-statedata = cmdutil.readgraftstate(repo, graftstate)
-if statedata.get('date'):
-opts['date'] = statedata['date']
-if statedata.get('user'):
-opts['user'] = statedata['user']
-if statedata.get('log'):
-opts['log'] = True
-if statedata.get('no_commit'):
-opts['no_commit'] = statedata.get('no_commit')
-nodes = statedata['nodes']
-revs = [repo[node].rev() for node in nodes]
+revs = cmdutil.continuegraftstate(repo, graftstate, opts)
 else:
 cmdutil.wrongtooltocontinue(repo, _('graft'))
 else:
@@ -2623,69 +2610,8 @@
 
 if opts.get('no_commit'):
 statedata['no_commit'] = True
-for pos, ctx in enumerate(repo.set("%ld", revs)):
-desc = '%d:%s "%s"' % (ctx.rev(), ctx,
-   ctx.description().split('\n', 1)[0])
-names = repo.nodetags(ctx.node()) + repo.nodebookmarks(ctx.node())
-if names:
-desc += ' (%s)' % ' '.join(names)
-ui.status(_('grafting %s\n') % desc)
-if opts.get('dry_run'):
-continue
-
-source = ctx.extra().get('source')
-extra = {}
-if source:
-extra['source'] = source
-extra['intermediate-source'] = ctx.hex()
-else:
-extra['source'] = ctx.hex()
-user = ctx.user()
-if opts.get('user'):
-user = opts['user']
-statedata['user'] = user
-date = ctx.date()
-if opts.get('date'):
-date = opts['date']
-statedata['date'] = date
-message = ctx.description()
-if opts.get('log'):
-message += '\n(grafted from %s)' % ctx.hex()
-statedata['log'] = True
-
-# we don't merge the first commit when continuing
-if not cont:
-# perform the graft merge with p1(rev) as 'ancestor'
-overrides = {('ui', 'forcemerge'): opts.get('tool', '')}
-base = ctx.p1() if basectx is None else basectx
-with ui.configoverride(overrides, 'graft'):
-stats = mergemod.graft(repo, ctx, base, ['local', 'graft'])
-# report any conflicts
-if stats.unresolvedcount > 0:
-# write out state for --continue
-nodes = [repo[rev].hex() for rev in revs[pos:]]
-statedata['nodes'] = nodes
-stateversion = 1
-graftstate.save(stateversion, statedata)
-hint = _("use 'hg resolve' and 'hg graft 

D6655: continue: added support for graft

2019-07-20 Thread taapas1128 (Taapas Agrawal)
taapas1128 added inline comments.

INLINE COMMENTS

> martinvonz wrote in test-graft.t:1
> I tried to fix that but the test fails if I do that.

I will have a look.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6655/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D6655

To: taapas1128, #hg-reviewers
Cc: yuja, mharbison72, martinvonz, durin42, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D6655: continue: added support for graft

2019-07-20 Thread taapas1128 (Taapas Agrawal)
taapas1128 added a comment.


  @yuja have a look at D6659  and suggest 
changes there. Extracting the core `for` loop as a helper function sounds like 
a nice idea. I will update the patch for the same.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6655/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D6655

To: taapas1128, #hg-reviewers
Cc: yuja, mharbison72, martinvonz, durin42, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D6655: continue: added support for graft

2019-07-20 Thread yuja (Yuya Nishihara)
yuja added a comment.


  > It looks like pretty much this entire function is copies `commands.graft()`
  > and then all this code is left dead here (since `cont = True` above).
  > I'd prefer to de-queue this commit and let you clean this up and then
  > submit a new patch
  
  That's my feeling. Perhaps the core `for` loop can be extracted to a helper
  function. Or alternatively, `continuegraft()` can be implemented on top of
  commands.graft()?

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6655/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D6655

To: taapas1128, #hg-reviewers
Cc: yuja, mharbison72, martinvonz, durin42, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: D6655: continue: added support for graft

2019-07-20 Thread Yuya Nishihara
> It looks like pretty much this entire function is copies `commands.graft()`
> and then all this code is left dead here (since `cont = True` above).
> I'd prefer to de-queue this commit and let you clean this up and then
> submit a new patch

That's my feeling. Perhaps the core `for` loop can be extracted to a helper
function. Or alternatively, `continuegraft()` can be implemented on top of
commands.graft()?
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel